home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / aplictns / route_10 / part01 next >
Internet Message Format  |  1990-04-23  |  66KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i151: route 1.0 - printed circuit board router, Part01/06
  5. Message-ID: <12281@xanth.cs.odu.edu>
  6. Date: 23 Apr 90 00:08:39 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: finkel%TAURUS.BITNET@CUNYVM.CUNY.EDU
  9. Lines: 2343
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: finkel%TAURUS.BITNET@CUNYVM.CUNY.EDU
  15. Posting-number: Volume 90, Issue 151
  16. Archive-name: applications/route-1.0/part01
  17.  
  18. Enclosed is a C based PCB autorouter I found on a BBS ( Ciarcia's
  19. circuit cellar BBS ). It seems the file was picked up from Usenet. I
  20. tried mailing the author but got no reply.
  21.  
  22. Anyhow, the program was for an AT with an EGA monitor. I ported the
  23. autorouter and the previewer, but not the PCB printer, since it was
  24. intended for an HP LaserJet II printer, which I don't have. ...
  25.  
  26. The original previewer stored the different PCB patterns ( which includes
  27. holes, horizontal,vertical and diagonal lines, line corners, etc. ) in
  28. an integer matrix , with 1 for 'on' and  0 for 'off'. There are about
  29. 30 different patterns in 4 different sizes. The program used a routine
  30. similar to WritePixel to draw the PCB on the screen. not only was this slow
  31. ( about 10 seconds on a 12MHz AT for a full size board, with the program
  32. compiled for 286 instruction set, and 15 seconds for a direct port of
  33. the same program on the Amiga using WritePixel() ), but these arrays made
  34. the program much bigger than it should have been. I converted the previewer
  35. to use packed bitmap arrays ( like Image structures ), and use the
  36. BltPattern() routine to draw each PCB pattern, and now the screen update
  37. time has gone down to 2 seconds for a full board!
  38.  
  39. I kept all the old files in a seperate directory called 'old'. The
  40. original bitmap files are needed for the printer program which I still
  41. didn't port.  
  42.  
  43. [ the ``old'' directory is included in the sources posting only  ...tad]
  44.  
  45. Udi
  46.  
  47. #!/bin/sh
  48. # This is a shell archive.  Remove anything before this line, then unpack
  49. # it by saving it into a file and typing "sh file".  To overwrite existing
  50. # files, type "sh file -c".  You can also feed this as standard input via
  51. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  52. # will see the following message at the end:
  53. #        "End of archive 1 (of 6)."
  54. # Contents:  Makefile Readme.AMIGA alloc.c astar bfs bitblt.c bitblt1.h
  55. #   cell.h dist.c examples examples/ex1 examples/ex2 examples/example
  56. #   inc inc/ttl.inc inc/ttl7400.inc inc/ttl7401.inc inc/ttl7402.inc
  57. #   inc/ttl7403.inc inc/ttl7404.inc inc/ttl7405.inc inc/ttl7406.inc
  58. #   inc/ttl7407.inc inc/ttl7408.inc inc/ttl7409.inc inc/ttl7410.inc
  59. #   inc/ttl7411.inc inc/ttl7412.inc inc/ttl7413.inc inc/ttl7414.inc
  60. #   inc/ttl7415.inc inc/ttl7419.inc inc/ttl7420.inc inc/ttl7421.inc
  61. #   inc/ttl7422.inc inc/ttl7423.inc inc/ttl7424.inc inc/ttl7425.inc
  62. #   inc/ttl7426.inc inc/ttl7427.inc inc/ttl7428.inc inc/ttl7430.inc
  63. #   inc/ttl7431.inc inc/ttl7486.inc old old/bitmap.c old/bitmap1.h
  64. #   queue.c sources.hdr util.c work.c
  65. # Wrapped by tadguy@xanth on Sun Apr 22 20:07:54 1990
  66. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  67. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  68.   echo shar: Will not clobber existing file \"'Makefile'\"
  69. else
  70. echo shar: Extracting \"'Makefile'\" \(1551 characters\)
  71. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  72. X# printed circuit board autorouter, viewer, and printer
  73. X#
  74. X# Makefile.xen for Xenix 286 by Harold Hankins
  75. X#
  76. X
  77. X#
  78. X# .c.obj:
  79. X#     cl /G2s /Oat /W3 /Zp /c $*.c
  80. X# 
  81. X# .asm.obj:
  82. X#     masm /t /ml $*.asm;
  83. X# 
  84. XCFLAGS= -n
  85. XLIBS=    -lm -lc
  86. XLFLAGS = -g
  87. X
  88. XROBJS=    pcbroute.o io.o solve.o board.o queue.o work.o dist.o alloc.o
  89. XVOBJS=    pcbview.o bitmap.o board.o alloc.o util.o
  90. XVBOBJS=    pcbltv.o bitblt.o board.o alloc.o util.o
  91. XPOBJS=    pcbprint.o bitmap.o board.o alloc.o
  92. X
  93. X
  94. Xallprg:    pcbroute pcbprint pcbview
  95. X
  96. Xpcbroute: $(ROBJS)
  97. X    ln $(LFLAGS) -o pcbroute $(ROBJS) $(LIBS)
  98. X
  99. Xpcbview: $(VOBJS)
  100. X    ln $(LFLAGS)  -o pcbview $(VOBJS) $(LIBS)
  101. X
  102. Xpcbltv: $(VBOBJS)
  103. X    ln $(LFLAGS) +Cd -o pcbltv $(VBOBJS) $(LIBS)
  104. X
  105. Xpcbprint: $(POBJS)
  106. X    ln $(LFLAGS) -o pcbprint $(POBJS) $(LIBS)
  107. X
  108. Xprintr:
  109. X    @prl pcbroute.c io.c solve.c board.c queue.c work.c dist.c alloc.c cell.h
  110. X
  111. Xtestr:
  112. X    cd ../inc ; pcbroute example hwh.out ; sum hwh.*
  113. X
  114. Xtestp:
  115. X    cd ../inc ; pcbprint hwh.out 
  116. X
  117. Xpcbroute.o: pcbroute.c cell.h
  118. X
  119. Xio.o: io.c cell.h
  120. X
  121. Xsolve.o: solve.c cell.h
  122. X
  123. Xboard.o: board.c cell.h
  124. X
  125. Xqueue.o: queue.c cell.h
  126. X
  127. Xwork.o: work.c cell.h
  128. X
  129. Xdist.o: dist.c cell.h
  130. X
  131. Xalloc.o: alloc.c
  132. X
  133. Xpcbview.o: pcbview.c pcbview.h cell.h
  134. X    cc $(CFLAGS) +IAztec:include.pre pcbview.c
  135. X
  136. Xpcbltv.o: pcbltv.c pcbview.h cell.h
  137. X    cc $(CFLAGS) +IAztec:include.pre pcbltv.c
  138. X
  139. Xbitmap.o: bitmap.c cell.h bitmap1.h bitmap2.h bitmap3.h
  140. X
  141. Xbitblt.o: bitblt.c cell.h bitblt1.h bitblt2.h bitblt3.h
  142. X    cc $(CFLAGS) +IAztec:include.pre bitblt.c
  143. X
  144. Xutil.o: util.c
  145. X    cc $(CFLAGS) +IAztec:include.pre util.c
  146. X
  147. Xpcbprint.o: pcbprint.c cell.h
  148. X
  149. Xclean:
  150. X    @rm -f $(ROBJS) $(VOBJS) $(POBJS)
  151. END_OF_FILE
  152. if test 1551 -ne `wc -c <'Makefile'`; then
  153.     echo shar: \"'Makefile'\" unpacked with wrong size!
  154. fi
  155. # end of 'Makefile'
  156. fi
  157. if test -f 'Readme.AMIGA' -a "${1}" != "-c" ; then 
  158.   echo shar: Will not clobber existing file \"'Readme.AMIGA'\"
  159. else
  160. echo shar: Extracting \"'Readme.AMIGA'\" \(3212 characters\)
  161. sed "s/^X//" >'Readme.AMIGA' <<'END_OF_FILE'
  162. XAbout this package
  163. X------------------
  164. X
  165. XThis is a modified version of the PCB autorouting package written by
  166. XRandy Nevin. It has been ported to the Amiga and enhanced in a few
  167. Xways:
  168. X
  169. X1. The PCBView program has been intuition-ized. There are 2 versions of
  170. X   the previewer. One is called 'PCBView', just like the original, and
  171. X   the other one is called 'PCBltV', which standa for 'PCBlitterView'.
  172. X   The new previewer uses a new set of bitmap images or the board, which
  173. X   are stored in a more condensed form than the old program, even though
  174. X   it's less portable now. The old previewer used WritePixel() to draw
  175. X   the whole screen! The new previewer uses the Blitter ( BltPattern() ),
  176. X   and is about 8 times faster. The demo PCB, which took 15 seconds to
  177. X   draw at maximum size using the old previewer, now takes 2 seconds with
  178. X   the new previer. All the files related to the old viewer are in the
  179. X   'old' subdirectory in this archive file. Notice that PCBPrint.c is
  180. X   also there, since I didn't port it yet.
  181. X
  182. X2. The autorouter now supports routing of single sided boards. just add
  183. X   the '-s' switch when running PCBRoute. This is good for simple circuits,
  184. X   since double sided boards are much more difficult to manufacture for
  185. X   hobbyists, and not always there is a need for one.
  186. X
  187. X
  188. XFuture plans:
  189. X-------------
  190. X
  191. X1. Write a version of PCBPrint that will use the preference printer.
  192. X   Don't hold your breath for this, since I don't have a printer at
  193. X   home.
  194. X
  195. X2. Write a version of PCBPrint for PostScript printers. This is much
  196. X   easier for me to do, since I have access to a PostScript printer,
  197. X   and having a copy of GhostScript(*) for the Amiga surely helps...
  198. X
  199. X   [ GhostScript may or may not be a trademark of the Free Software
  200. X     Foundation ;-) ].
  201. X
  202. X3. Improving the autorouter. Currently, the autorouter will not try
  203. X   to retrace a trace if it disturbs another trace ( very important
  204. X   for single sided boards ), but I may TRY to change this in a
  205. X   future revision. Another optimization which comes to mind is
  206. X   that if A is connected to B, and B is connected to C, the router
  207. X   may choose to connect any 2 of the 3 possible connections ( A<>B,
  208. X   B<>C, and A<>C ), whichever gives the best result.
  209. X
  210. XNew files:
  211. X----------
  212. X
  213. Xpcbltv.c  - the modified source code for the new previewer.
  214. Xbitblt*.* - modified versions of bitmap*.* . Images are stored
  215. X            as bitmaps instead of a 2d array with 0's and 1's in it.
  216. X            The images in bitmap*.h are stored upside down. The images in
  217. X            bitblt*.h are stored normally.
  218. X
  219. XDisclaimer:
  220. X-----------
  221. XSee the original disclaimer in the file 'ReadMe'. it applies to my
  222. Xchanges as well.
  223. X
  224. XIf you have any suggestions, improvements, questions, etc., you can send
  225. Xthem to:
  226. X
  227. XUdi Finkelstein
  228. X10 Glitzenstein st.
  229. X64686 Tel Aviv
  230. XIsrael
  231. X
  232. Xor, if you have EMail access:
  233. X
  234. Xfinkel@taurus.BITNET
  235. X
  236. XIf you have any questions about the previewer, you can ask me. If
  237. Xyou have any questions about the router itself, you will be better
  238. Xoff asking Randy Nevin himself, who surely knows better about it's
  239. Xinternal structure than me... Randy Nevin's address is ( copied
  240. Xfrom the 'Readme' file he wrote ):
  241. X
  242. X
  243. XRandy Nevin, 1731 211th pl ne, redmond, wa 98053
  244. END_OF_FILE
  245. if test 3212 -ne `wc -c <'Readme.AMIGA'`; then
  246.     echo shar: \"'Readme.AMIGA'\" unpacked with wrong size!
  247. fi
  248. # end of 'Readme.AMIGA'
  249. fi
  250. if test -f 'alloc.c' -a "${1}" != "-c" ; then 
  251.   echo shar: Will not clobber existing file \"'alloc.c'\"
  252. else
  253. echo shar: Extracting \"'alloc.c'\" \(1106 characters\)
  254. sed "s/^X//" >'alloc.c' <<'END_OF_FILE'
  255. X#include <stdio.h>
  256. X
  257. Xextern char *malloc();
  258. X
  259. Xvoid Nomem();
  260. X
  261. X/*
  262. X * allocate x bytes of far memory
  263. X */
  264. Xchar *Alloc(x)
  265. Xlong x;
  266. X{
  267. X    char *fp;
  268. X
  269. X    if (x >= 0x10000) {
  270. X        printf("Error! malloc() too big!\n");
  271. X        exit(-1);
  272. X    }
  273. X    if ((fp = malloc((short) x)) == NULL)
  274. X        Nomem();        /* memory allocation error */
  275. X    return(fp);
  276. X}
  277. X
  278. X/*
  279. X * a memory allocation request has failed
  280. X */
  281. Xvoid Nomem ()
  282. X{
  283. X    printf( "out of memory\n" );
  284. X    exit( -1 );
  285. X}
  286. X
  287. X/*
  288. X * Free memory alloctated by Alloc();
  289. X */
  290. XFree(x)
  291. Xchar *x;
  292. X{
  293. X    free(x);
  294. X}
  295. X
  296. X/* edlib  version 1.0 of 04/08/88 */
  297. X/*
  298. X    string to upper changes all lower case letters in a string to upper
  299. X    case.
  300. X*/
  301. X#include <ctype.h>
  302. X
  303. Xchar *strupr(str)
  304. Xchar *str;
  305. X{
  306. X    char *temp = str;
  307. X
  308. X    for ( ; *temp ; temp++ )
  309. X        *temp = (char) toupper(*temp);
  310. X
  311. X    return(str);
  312. X}
  313. X
  314. Xint stricmp(str1,str2)
  315. Xchar *str1,*str2;
  316. X{
  317. X    int index = 0;
  318. X
  319. X    while ( str1[index] && str2[index] &&
  320. X            tolower(str1[index]) == tolower(str2[index]) )
  321. X        ++index;
  322. X
  323. X    return( (tolower(str1[index]) < tolower(str2[index])) ? -1 :
  324. X          ( (tolower(str1[index]) > tolower(str2[index])) ?  1 : 0) );
  325. X}
  326. END_OF_FILE
  327. if test 1106 -ne `wc -c <'alloc.c'`; then
  328.     echo shar: \"'alloc.c'\" unpacked with wrong size!
  329. fi
  330. # end of 'alloc.c'
  331. fi
  332. if test -f 'astar' -a "${1}" != "-c" ; then 
  333.   echo shar: Will not clobber existing file \"'astar'\"
  334. else
  335. echo shar: Extracting \"'astar'\" \(2952 characters\)
  336. sed "s/^X//" >'astar' <<'END_OF_FILE'
  337. XA* Algorithm  (* heuristic search *)
  338. X   (* Search a graph or state space, depending on the problem definition. *)
  339. X   (* S is the start node, T is the goal node. *)
  340. X   (* Open is an ordered list of nodes (ordered by lowest F value; see below),
  341. X      also called a priority queue. Closed is a set of nodes (order doesn't
  342. X      matter). In general, nodes that need to be searched are put on Open (at
  343. X      the proper position). As they are searched, they are removed from Open
  344. X      and put in Closed. Occasionally a newer, better route will be found to a
  345. X      node after it has already been searched, in which case we remove it from
  346. X      Closed and put it back on Open to be reconsidered. *)
  347. X   (* G[x] is the distance already traveled to get from S to node x, and is
  348. X      known exactly. H(x) is a function (heuristic) which returns an estimate
  349. X      of the distance from node x to T. F[x] is the estimated distance from S
  350. X      to T by going through node x, and is computed by F[x] = G[x] + H(x).
  351. X      H(x) can be calculated for any node, but F[x] and G[x] only become
  352. X      defined when node x is visited. *)
  353. X   (* Pred is defined for each node, and is a list of "came from" indications,
  354. X      so when we finally reach T, we traverse Pred to construct a path to
  355. X      S. *)
  356. X   (* Distance(x,y) is a function for calculating the distance between two
  357. X      neighboring nodes. *)
  358. X1  Open <- {S}  (* a list of one element *)
  359. X   Closed <- {}  (* the empty set *)
  360. X   G[S] <- 0,  F[S] <- 0,  Pred[S] <- NULL,  found <- FALSE
  361. X   WHILE Open <> {} and not found DO
  362. X5     x <- the first node on Open  (* node with smallest F value *)
  363. X      Open <- Open - {x}  (* remove x from Open *)
  364. X      Closed <- Closed + {x}  (* put x in Closed *)
  365. X      IF x = T THEN found <- TRUE  (* we're done *)
  366. X      ELSE  (* continue search through node x *)
  367. X10       let R be the set of neighboring nodes of x
  368. X         FOR each y in R DO
  369. X            IF y is not on Open or in Closed THEN
  370. X               G[y] <- G[x] + Distance(x,y)
  371. X               F[y] <- G[y] + H(y)  (* estimate solution path length *)
  372. X15             Pred[y] <- x  (* remember where we came from *)
  373. X               Open <- Open + {y}  (* put y on Open *)
  374. X            ELSE  (* y is on Open or in Closed *)
  375. X               IF (G[x] + Distance(x,y)) < G[y] THEN
  376. X                  (* we've found a better route to y *)
  377. X20                G[y] <- G[x] + Distance(x,y)
  378. X                  F[y] <- G[y] + H(y)
  379. X                  Pred[y] <- x  (* remember where we came from *)
  380. X                  IF y is on Open THEN
  381. X                     reposition y according to F[y]
  382. X25                ELSE  (* y is in Closed *)
  383. X                     Closed <- Closed - {y}  (* remove y from Closed *)
  384. X                     Open <- Open + {y}  (* put y on Open *)
  385. X   IF found THEN
  386. X      use Pred[T] to find Pred[Pred[T]] and so on until S is reached
  387. X30    (* this traces out the solution path in reverse *)
  388. X   ELSE T cannot be reached from S
  389. END_OF_FILE
  390. if test 2952 -ne `wc -c <'astar'`; then
  391.     echo shar: \"'astar'\" unpacked with wrong size!
  392. fi
  393. # end of 'astar'
  394. fi
  395. if test -f 'bfs' -a "${1}" != "-c" ; then 
  396.   echo shar: Will not clobber existing file \"'bfs'\"
  397. else
  398. echo shar: Extracting \"'bfs'\" \(1498 characters\)
  399. sed "s/^X//" >'bfs' <<'END_OF_FILE'
  400. XBFS Algorithm  (* breadth-first search *)
  401. X   (* Search a graph or state space, depending on the problem definition. *)
  402. X   (* S is the start node, T is the goal node. *)
  403. X   (* Open is an ordered list of nodes (ordered by arrival time; nodes enter
  404. X      at the tail and leave at the head), also called a queue. Closed is a set
  405. X      of nodes (order doesn't matter). In general, nodes that need to be
  406. X      searched are put on Open. As they are searched, they are removed from
  407. X      Open and put in Closed. *)
  408. X   (* Pred is defined for each node, and is a list of "came from" indications,
  409. X      so when we finally reach T, we traverse Pred to construct a path to S. *)
  410. X1  Open <- {S}  (* a list of one element *)
  411. X   Closed <- {}  (* the empty set *)
  412. X   Pred[S] <- NULL,  found <- FALSE
  413. X   WHILE Open <> {} and not found DO
  414. X5     x <- the first node on Open
  415. X      Open <- Open - {x}  (* remove x from Open *)
  416. X      Closed <- Closed + {x}  (* put x in Closed *)
  417. X      IF x = T THEN found <- TRUE  (* we're done *)
  418. X      ELSE  (* continue search through node x *)
  419. X10       let R be the set of neighboring nodes of x
  420. X         FOR each y in R DO
  421. X            IF y is not on Open or in Closed THEN
  422. X               Pred[y] <- x  (* remember where we came from *)
  423. X               Open <- Open + {y}  (* put y on Open (at the tail) *)
  424. X15 IF found THEN
  425. X      use Pred[T] to find Pred[Pred[T]] and so on until S is reached
  426. X      (* this traces out the solution path in reverse *)
  427. X   ELSE T cannot be reached from S
  428. END_OF_FILE
  429. if test 1498 -ne `wc -c <'bfs'`; then
  430.     echo shar: \"'bfs'\" unpacked with wrong size!
  431. fi
  432. # end of 'bfs'
  433. fi
  434. if test -f 'bitblt.c' -a "${1}" != "-c" ; then 
  435.   echo shar: Will not clobber existing file \"'bitblt.c'\"
  436. else
  437. echo shar: Extracting \"'bitblt.c'\" \(1324 characters\)
  438. sed "s/^X//" >'bitblt.c' <<'END_OF_FILE'
  439. X#include "cell.h"
  440. X
  441. X#define ZOOM0    3    /* 3x3 pixels per cell        */
  442. X#define ZOOM1    6    /* 6x6 pixels per cell        */
  443. X#define ZOOM2    10    /* 10x10 pixels per cell    */
  444. X#define ZOOM3    18    /* 18x18 pixels per cell    */
  445. X
  446. X/*
  447. X** the templates assume the pixels on your screen have a 1:1 aspect ratio. for
  448. X** almost all screens, this is not true. therefore, the screen view will be
  449. X** slightly distorted (things will look like they are stretched top to bottom,
  450. X** or squashed side to side). if you really want things to look like reality,
  451. X** you could change the dimensions of the templates. for example, if your
  452. X** screen has a 2:1 aspect ratio (most are more like 1.4:1), use a [3][6]
  453. X** template instead of a [3][3] one. as long as you keep this in mind while
  454. X** viewing the results, it's probably not worth the effort.
  455. X*/
  456. X
  457. Xstruct templates { /* group the bit templates for an object */
  458. X    long t;                /* the object type */
  459. X    struct Image im[4];    /* tiny, small, medium, large zoom templates */
  460. X};
  461. X
  462. X/* these got too big to keep in one file, so i moved them to include files */
  463. X
  464. X#include "bitblt1.h"
  465. X
  466. X#include "bitblt2.h"
  467. X
  468. X#include "bitblt3.h"
  469. X
  470. Xint z1 = sizeof(y1)/sizeof(y1[0]);  /* number of hole types        */
  471. Xint z2 = sizeof(y2)/sizeof(y2[0]);  /* number of hole-related types    */
  472. Xint z3 = sizeof(y3)/sizeof(y3[0]);  /* number of non-hole-related types    */
  473. END_OF_FILE
  474. if test 1324 -ne `wc -c <'bitblt.c'`; then
  475.     echo shar: \"'bitblt.c'\" unpacked with wrong size!
  476. fi
  477. # end of 'bitblt.c'
  478. fi
  479. if test -f 'bitblt1.h' -a "${1}" != "-c" ; then 
  480.   echo shar: Will not clobber existing file \"'bitblt1.h'\"
  481. else
  482. echo shar: Extracting \"'bitblt1.h'\" \(937 characters\)
  483. sed "s/^X//" >'bitblt1.h' <<'END_OF_FILE'
  484. X/* hole templates */
  485. X/* NOTE: these templates are UPSIDE-DOWN from what you see on the screen!!! */
  486. X
  487. X/*
  488. X * hole templates
  489. X */
  490. X
  491. XUSHORT Hole0[] = {
  492. X    0x0000,
  493. X    0x4000,
  494. X    0x0000
  495. X};
  496. X
  497. XUSHORT Hole1[] = {
  498. X    0x0000,
  499. X    0x3000,
  500. X    0x4800,
  501. X    0x4800,
  502. X    0x3000,
  503. X    0x0000
  504. X};
  505. X
  506. XUSHORT Hole2[] = {
  507. X    0x0000,
  508. X    0x0000,
  509. X    0x0c00,
  510. X    0x1200,
  511. X    0x2100,
  512. X    0x2100,
  513. X    0x1200,
  514. X    0x0c00,
  515. X    0x0000,
  516. X    0x0000
  517. X};
  518. X
  519. XUSHORT Hole3[] = {
  520. X    0x0000, 0x0000,
  521. X    0x0000, 0x0000,
  522. X    0x0000, 0x0000,
  523. X    0x0000, 0x0000,
  524. X    0x03f0, 0x0000,
  525. X    0x0408, 0x0000,
  526. X    0x0804, 0x0000,
  527. X    0x0804, 0x0000,
  528. X    0x0804, 0x0000,
  529. X    0x0804, 0x0000,
  530. X    0x0804, 0x0000,
  531. X    0x0804, 0x0000,
  532. X    0x0408, 0x0000,
  533. X    0x03f0, 0x0000,
  534. X    0x0000, 0x0000,
  535. X    0x0000, 0x0000,
  536. X    0x0000, 0x0000,
  537. X    0x0000, 0x0000
  538. X};
  539. X
  540. Xstruct templates y1[] = {
  541. X    {
  542. X        HOLE, {
  543. X            { 0, 0, ZOOM0, ZOOM0, 1, Hole0, 7, 0, NULL },
  544. X            { 0, 0, ZOOM1, ZOOM1, 1, Hole1, 7, 0, NULL },
  545. X            { 0, 0, ZOOM2, ZOOM2, 1, Hole2, 7, 0, NULL },
  546. X            { 0, 0, ZOOM3, ZOOM3, 1, Hole3, 7, 0, NULL },
  547. X        }
  548. X    }
  549. X};
  550. END_OF_FILE
  551. if test 937 -ne `wc -c <'bitblt1.h'`; then
  552.     echo shar: \"'bitblt1.h'\" unpacked with wrong size!
  553. fi
  554. # end of 'bitblt1.h'
  555. fi
  556. if test -f 'cell.h' -a "${1}" != "-c" ; then 
  557.   echo shar: Will not clobber existing file \"'cell.h'\"
  558. else
  559. echo shar: Extracting \"'cell.h'\" \(2939 characters\)
  560. sed "s/^X//" >'cell.h' <<'END_OF_FILE'
  561. X/* the low-order bit indicates a hole */
  562. X#define HOLE            0x00000001L    /* a conducting hole */
  563. X
  564. X/* traces radiating outward from a hole to a side or corner */
  565. X#define HOLE_NORTH        0x00000002L    /* upward        */
  566. X#define HOLE_NORTHEAST        0x00000004L    /* upward and right    */
  567. X#define HOLE_EAST        0x00000008L    /* to the right        */
  568. X#define HOLE_SOUTHEAST        0x00000010L    /* downward and right    */
  569. X#define HOLE_SOUTH        0x00000020L    /* downward        */
  570. X#define HOLE_SOUTHWEST        0x00000040L    /* downward and left    */
  571. X#define HOLE_WEST        0x00000080L    /* to the left        */
  572. X#define HOLE_NORTHWEST        0x00000100L    /* upward and left    */
  573. X
  574. X/* straight lines through the center */
  575. X#define LINE_HORIZONTAL        0x00000002L    /* left-to-right line    */
  576. X#define LINE_VERTICAL        0x00000004L    /* top-to-bottom line    */
  577. X
  578. X/* lines cutting across a corner, connecting adjacent sides */
  579. X#define CORNER_NORTHEAST    0x00000008L    /* upper right corner    */
  580. X#define CORNER_SOUTHEAST    0x00000010L    /* lower right corner    */
  581. X#define CORNER_SOUTHWEST    0x00000020L    /* lower left corner    */
  582. X#define CORNER_NORTHWEST    0x00000040L    /* upper left corner    */
  583. X
  584. X/* diagonal lines through the center */
  585. X#define DIAG_NEtoSW        0x00000080L    /* northeast to southwest */
  586. X#define DIAG_SEtoNW        0x00000100L    /* southeast to northwest */
  587. X
  588. X/* 135 degree angle side-to-far-corner lines */
  589. X#define BENT_NtoSE        0x00000200L    /* north to southeast    */
  590. X#define BENT_NtoSW        0x00000400L    /* north to southwest    */
  591. X#define BENT_EtoSW        0x00000800L    /* east to southwest    */
  592. X#define BENT_EtoNW        0x00001000L    /* east to northwest    */
  593. X#define BENT_StoNW        0x00002000L    /* south to northwest    */
  594. X#define BENT_StoNE        0x00004000L    /* south to northeast    */
  595. X#define BENT_WtoNE        0x00008000L    /* west to northeast    */
  596. X#define BENT_WtoSE        0x00010000L    /* west to southeast    */
  597. X
  598. X/* 90 degree corner-to-adjacent-corner lines */
  599. X#define ANGLE_NEtoSE        0x00020000L    /* northeast to southeast */
  600. X#define ANGLE_SEtoSW        0x00040000L    /* southeast to southwest */
  601. X#define ANGLE_SWtoNW        0x00080000L    /* southwest to northwest */
  602. X#define ANGLE_NWtoNE        0x00100000L    /* northwest to northeast */
  603. X
  604. X/* 45 degree angle side-to-near-corner lines */
  605. X#define SHARP_NtoNE        0x00200000L    /* north to northeast    */
  606. X#define SHARP_EtoNE        0x00400000L    /* east to northeast    */
  607. X#define SHARP_EtoSE        0x00800000L    /* east to southeast    */
  608. X#define SHARP_StoSE        0x01000000L    /* south to southeast    */
  609. X#define SHARP_StoSW        0x02000000L    /* south to southwest    */
  610. X#define SHARP_WtoSW        0x04000000L    /* west to southwest    */
  611. X#define SHARP_WtoNW        0x08000000L    /* west to northwest    */
  612. X#define SHARP_NtoNW        0x10000000L    /* north to northwest    */
  613. X
  614. X/* directions the cell can be reached from (point to previous cell) */
  615. X#define FROM_NORTH        1
  616. X#define FROM_NORTHEAST        2
  617. X#define FROM_EAST        3
  618. X#define FROM_SOUTHEAST        4
  619. X#define FROM_SOUTH        5
  620. X#define FROM_SOUTHWEST        6
  621. X#define FROM_WEST        7
  622. X#define FROM_NORTHWEST        8
  623. X#define FROM_OTHERSIDE        9
  624. X
  625. X#define    TOP    0
  626. X#define BOTTOM    1
  627. X#define EMPTY    0
  628. X#define ILLEGAL    -1
  629. X
  630. X#ifdef M_XENIX
  631. Xchar far *_fmalloc();
  632. X#endif
  633. X
  634. END_OF_FILE
  635. if test 2939 -ne `wc -c <'cell.h'`; then
  636.     echo shar: \"'cell.h'\" unpacked with wrong size!
  637. fi
  638. # end of 'cell.h'
  639. fi
  640. if test -f 'dist.c' -a "${1}" != "-c" ; then 
  641.   echo shar: Will not clobber existing file \"'dist.c'\"
  642. else
  643. echo shar: Extracting \"'dist.c'\" \(3896 characters\)
  644. sed "s/^X//" >'dist.c' <<'END_OF_FILE'
  645. X#include <stdio.h>
  646. X#include "cell.h"
  647. X
  648. Xint GetApxDist ( r1, c1, r2, c2 ) /* calculate approximate distance */
  649. X    int r1, c1, r2, c2;
  650. X    {
  651. X    register int d1, d2; /* row and column deltas */
  652. X    int d0; /* temporary variable for swapping d1 and d2 */
  653. X
  654. X    /* NOTE: the -25 used below is because we are not going from the   */
  655. X    /* center of (r1,c1) to the center of (r2,c2), we are going from   */
  656. X    /* the edge of a hole at (r1,c1) to the edge of a hole at (r2,c2). */
  657. X    /* holes are 25 mils in diameter (12.5 mils in radius), so we back */
  658. X    /* off by 2 radii.                           */
  659. X    if ((d1 = r1-r2) < 0) /* get absolute row delta */
  660. X        d1 = -d1;
  661. X    if ((d2 = c1-c2) < 0) /* get absolute column delta */
  662. X        d2 = -d2;
  663. X    if (!d1) /* in same row? */
  664. X        return( (d2*50)-25 ); /* 50 mils per cell */
  665. X    if (!d2) /* in same column? */
  666. X        return( (d1*50)-25 ); /* 50 mils per cell */
  667. X    if (d1 > d2) { /* get smaller into d1 */
  668. X        d0 = d1;
  669. X        d1 = d2;
  670. X        d2 = d0;
  671. X        }
  672. X    d2 -= d1; /* get non-diagonal part of approximate "route" */
  673. X    return( (d1*71)+(d2*50)-25 ); /* 71 mils diagonally per cell */
  674. X    }
  675. X
  676. X/* distance to go thru a cell */
  677. Xstatic int dist[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
  678. X     /* N, NE,  E, SE,  S, SW,  W, NW,   OT, OR */
  679. X/* N  */ { 50, 60, 35, 60, 99, 60, 35, 60,   12, 12 },
  680. X/* NE */ { 60, 71, 60, 71, 60, 99, 60, 71,   23, 23 },
  681. X/* E  */ { 35, 60, 50, 60, 35, 60, 99, 60,   12, 12 },
  682. X/* SE */ { 60, 71, 60, 71, 60, 71, 60, 99,   23, 23 },
  683. X/* S  */ { 99, 60, 35, 60, 50, 60, 35, 60,   12, 12 },
  684. X/* SW */ { 60, 99, 60, 71, 60, 71, 60, 71,   23, 23 },
  685. X/* W  */ { 35, 60, 99, 60, 35, 60, 50, 60,   12, 12 },
  686. X/* NW */ { 60, 71, 60, 99, 60, 71, 60, 71,   23, 23 },
  687. X
  688. X/* OT */ { 12, 23, 12, 23, 12, 23, 12, 23,   99, 99 },
  689. X/* OR */ { 99, 99, 99, 99, 99, 99, 99, 99,   99, 99 }
  690. X    };
  691. X
  692. X/* distance around (circular) segment of hole */
  693. Xstatic int circ[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
  694. X     /* N, NE,  E, SE,  S, SW,  W, NW,   OT, OR */
  695. X/* N  */ { 39, 29, 20, 10,  0, 10, 20, 29,   99, 0 },
  696. X/* NE */ { 29, 39, 29, 20, 10,  0, 10, 20,   99, 0 },
  697. X/* E  */ { 20, 29, 39, 29, 20, 10,  0, 10,   99, 0 },
  698. X/* SE */ { 10, 20, 29, 39, 29, 20, 10,  0,   99, 0 },
  699. X/* S  */ {  0, 10, 20, 29, 39, 29, 20, 10,   99, 0 },
  700. X/* SW */ { 10,  0, 10, 20, 29, 39, 29, 20,   99, 0 },
  701. X/* W  */ { 20, 10,  0, 10, 20, 29, 39, 29,   99, 0 },
  702. X/* NW */ { 29, 20, 10,  0, 10, 20, 29, 39,   99, 0 },
  703. X
  704. X/* OT */ { 99, 99, 99, 99, 99, 99, 99, 99,   99, 0 },
  705. X/* OR */ { 99, 99, 99, 99, 99, 99, 99, 99,   99, 0 }
  706. X    };
  707. X
  708. X/* penalty for extraneous holes and corners, scaled by sharpness of turn */
  709. Xstatic int penalty[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
  710. X     /* N, NE,  E, SE,  S, SW,  W, NW,   OT, OR */
  711. X/* N  */ {  0,  5, 10, 15, 20, 15, 10,  5,   50, 0 },
  712. X/* NE */ {  5,  0,  5, 10, 15, 20, 15, 10,   50, 0 },
  713. X/* E  */ { 10,  5,  0,  5, 10, 15, 20, 15,   50, 0 },
  714. X/* SE */ { 15, 10,  5,  0,  5, 10, 15, 20,   50, 0 },
  715. X/* S  */ { 20, 15, 10,  5,  0,  5, 10, 15,   50, 0 },
  716. X/* SW */ { 15, 20, 15, 10,  5,  0,  5, 10,   50, 0 },
  717. X/* W  */ { 10, 15, 20, 15, 10,  5,  0,  5,   50, 0 },
  718. X/* NW */ {  5, 10, 15, 20, 15, 10,  5,  0,   50, 0 },
  719. X
  720. X/* OT */ { 50, 50, 50, 50, 50, 50, 50, 50,  100, 0 },
  721. X/* OR */ {  0,  0,  0,  0,  0,  0,  0,  0,    0, 0 }
  722. X    };
  723. X
  724. X/*
  725. X** x is the direction to enter the cell of interest.
  726. X** y is the direction to exit the cell of interest.
  727. X** z is the direction to really exit the cell, if y=FROM_OTHERSIDE.
  728. X**
  729. X** return the distance of the trace through the cell of interest.
  730. X** the calculation is driven by the tables above.
  731. X*/
  732. X
  733. Xint CalcDist ( x, y, z ) /* calculate distance of a trace through a cell */
  734. X    int x, y, z;
  735. X    {
  736. X    int adjust;
  737. X
  738. X    adjust = 0; /* set if hole is encountered */
  739. X    if (x == EMPTY)
  740. X        x = 10;
  741. X    if (y == EMPTY)
  742. X        y = 10;
  743. X    else if (y == FROM_OTHERSIDE) {
  744. X        if (z == EMPTY)
  745. X            z = 10;
  746. X        adjust = circ[x-1][z-1] + penalty[x-1][z-1];
  747. X        }
  748. X    return( dist[x-1][y-1] + penalty[x-1][y-1] + adjust );
  749. X    }
  750. END_OF_FILE
  751. if test 3896 -ne `wc -c <'dist.c'`; then
  752.     echo shar: \"'dist.c'\" unpacked with wrong size!
  753. fi
  754. # end of 'dist.c'
  755. fi
  756. if test ! -d 'examples' ; then
  757.     echo shar: Creating directory \"'examples'\"
  758.     mkdir 'examples'
  759. fi
  760. if test -f 'examples/ex1' -a "${1}" != "-c" ; then 
  761.   echo shar: Will not clobber existing file \"'examples/ex1'\"
  762. else
  763. echo shar: Extracting \"'examples/ex1'\" \(821 characters\)
  764. sed "s/^X//" >'examples/ex1' <<'END_OF_FILE'
  765. X; This example shows how PRIORITY can be used to correctly route a one
  766. X; sided board which was otherwise un-route-able.
  767. X; ex1 - the example file without 'priority' keyword
  768. X; ex2 - the example file after adding 'priority' keyword to 2 of the lines.
  769. X
  770. Xdimension (15,30)
  771. X
  772. Xinclude pcbinc:ttl7400.inc
  773. X
  774. X; power and ground are supplied here
  775. Xhole (3,20)
  776. Xhole (3,25)
  777. X
  778. X; ~R - input
  779. Xhole (15,5)
  780. X; ~S - input
  781. Xhole (15,7)
  782. X
  783. X; Q - output
  784. Xhole (3,9)
  785. X; ~Q - output
  786. Xhole (3,11)
  787. X
  788. X; four instances of the above chip
  789. Xchipat (6,5) name=nand0 type=ttl7400 orientation=normal
  790. X
  791. X; connect power and ground to all chips
  792. Xconnect (3,20) and nand0.vcc
  793. Xconnect (3,25) and nand0.gnd
  794. Xconnect (15,5) and nand0.a1
  795. Xconnect (15,7) and nand0.a2
  796. Xconnect nand0.y1 and nand0.b2
  797. Xconnect nand0.y2 and nand0.b1
  798. Xconnect nand0.y1 and (3,9)
  799. Xconnect nand0.y2 and (3,11)
  800. END_OF_FILE
  801. if test 821 -ne `wc -c <'examples/ex1'`; then
  802.     echo shar: \"'examples/ex1'\" unpacked with wrong size!
  803. fi
  804. # end of 'examples/ex1'
  805. fi
  806. if test -f 'examples/ex2' -a "${1}" != "-c" ; then 
  807.   echo shar: Will not clobber existing file \"'examples/ex2'\"
  808. else
  809. echo shar: Extracting \"'examples/ex2'\" \(839 characters\)
  810. sed "s/^X//" >'examples/ex2' <<'END_OF_FILE'
  811. X; This example shows how PRIORITY can be used to correctly route a one
  812. X; sided board which was otherwise un-route-able.
  813. X; ex1 - the example file without 'priority' keyword
  814. X; ex2 - the example file after adding 'priority' keyword to 2 of the lines.
  815. X
  816. Xdimension (15,30)
  817. X
  818. Xinclude pcbinc:ttl7400.inc
  819. X
  820. X; power and ground are supplied here
  821. Xhole (3,20)
  822. Xhole (3,25)
  823. X
  824. X; ~R - input
  825. Xhole (15,5)
  826. X; ~S - input
  827. Xhole (15,7)
  828. X
  829. X; Q - output
  830. Xhole (3,9)
  831. X; ~Q - output
  832. Xhole (3,11)
  833. X
  834. X; four instances of the above chip
  835. Xchipat (6,5) name=nand0 type=ttl7400 orientation=normal
  836. X
  837. X; connect power and ground to all chips
  838. Xconnect (3,20) and nand0.vcc
  839. Xconnect (3,25) and nand0.gnd
  840. Xpriority connect (15,5) and nand0.a1
  841. Xpriority connect (15,7) and nand0.a2
  842. Xconnect nand0.y1 and nand0.b2
  843. Xconnect nand0.y2 and nand0.b1
  844. Xconnect nand0.y1 and (3,9)
  845. Xconnect nand0.y2 and (3,11)
  846. END_OF_FILE
  847. if test 839 -ne `wc -c <'examples/ex2'`; then
  848.     echo shar: \"'examples/ex2'\" unpacked with wrong size!
  849. fi
  850. # end of 'examples/ex2'
  851. fi
  852. if test -f 'examples/example' -a "${1}" != "-c" ; then 
  853.   echo shar: Will not clobber existing file \"'examples/example'\"
  854. else
  855. echo shar: Extracting \"'examples/example'\" \(2104 characters\)
  856. sed "s/^X//" >'examples/example' <<'END_OF_FILE'
  857. X; a circuit for calculating a parity bit for a 16-bit word (an xor tree)
  858. Xdimension (29,37)
  859. X
  860. X; include necessary part
  861. Xinclude pcbinc:ttl7486.inc
  862. X
  863. X; power and ground are supplied here
  864. Xhole (3,20)
  865. Xhole (3,25)
  866. X
  867. X; the 16-bit input word
  868. Xhole (26,5)
  869. Xhole (26,7)
  870. Xhole (26,9)
  871. Xhole (26,11)
  872. Xhole (26,13)
  873. Xhole (26,15)
  874. Xhole (26,17)
  875. Xhole (26,19)
  876. Xhole (26,21)
  877. Xhole (26,23)
  878. Xhole (26,25)
  879. Xhole (26,27)
  880. Xhole (26,29)
  881. Xhole (26,31)
  882. Xhole (26,33)
  883. Xhole (26,35)
  884. X
  885. X; the output (parity) bit
  886. Xhole (3,11)
  887. X
  888. X; four instances of the above chip
  889. Xchipat (6,5) name=xor0 type=ttl7486 orientation=normal
  890. Xchipat (6,21) name=xor1 type=ttl7486 orientation=normal
  891. Xchipat (16,5) name=xor2 type=ttl7486 orientation=normal
  892. Xchipat (16,21) name=xor3 type=ttl7486 orientation=normal
  893. X
  894. X; connect power and ground to all chips
  895. Xpriority connect (3,20) and xor0.vcc
  896. Xpriority connect (3,20) and xor1.vcc
  897. Xpriority connect (3,20) and xor2.vcc
  898. Xpriority connect (3,20) and xor3.vcc
  899. Xpriority connect (3,25) and xor0.gnd
  900. Xpriority connect (3,25) and xor1.gnd
  901. Xpriority connect (3,25) and xor2.gnd
  902. Xpriority connect (3,25) and xor3.gnd
  903. X
  904. X; condense 16 bits into 8 bits
  905. Xconnect (26,5) and xor2.a1
  906. Xconnect (26,7) and xor2.b1
  907. Xconnect (26,9) and xor2.a2
  908. Xconnect (26,11) and xor2.b2
  909. Xconnect (26,13) and xor2.a3
  910. Xconnect (26,15) and xor2.b3
  911. Xconnect (26,17) and xor2.a4
  912. Xconnect (26,19) and xor2.b4
  913. Xconnect (26,21) and xor3.a1
  914. Xconnect (26,23) and xor3.b1
  915. Xconnect (26,25) and xor3.a2
  916. Xconnect (26,27) and xor3.b2
  917. Xconnect (26,29) and xor3.a3
  918. Xconnect (26,31) and xor3.b3
  919. Xconnect (26,33) and xor3.a4
  920. Xconnect (26,35) and xor3.b4
  921. X
  922. X; condense 8 bits into 4 bits
  923. Xconnect xor2.y1 and xor1.a1
  924. Xconnect xor2.y2 and xor1.b1
  925. Xconnect xor2.y3 and xor1.a2
  926. Xconnect xor2.y4 and xor1.b2
  927. Xconnect xor3.y1 and xor1.a3
  928. Xconnect xor3.y2 and xor1.b3
  929. Xconnect xor3.y3 and xor1.a4
  930. Xconnect xor3.y4 and xor1.b4
  931. X
  932. X; condense 4 bits into 2 bits
  933. Xconnect xor1.y1 and xor0.a1
  934. Xconnect xor1.y2 and xor0.b1
  935. Xconnect xor1.y3 and xor0.a2
  936. Xconnect xor1.y4 and xor0.b2
  937. X
  938. X; condense 2 bits into 1 bit
  939. Xconnect xor0.y1 and xor0.a3
  940. Xconnect xor0.y2 and xor0.b3
  941. X
  942. X; connect the output (parity) bit
  943. Xpriority connect xor0.y3 and (3,11)
  944. END_OF_FILE
  945. if test 2104 -ne `wc -c <'examples/example'`; then
  946.     echo shar: \"'examples/example'\" unpacked with wrong size!
  947. fi
  948. # end of 'examples/example'
  949. fi
  950. if test ! -d 'inc' ; then
  951.     echo shar: Creating directory \"'inc'\"
  952.     mkdir 'inc'
  953. fi
  954. if test -f 'inc/ttl.inc' -a "${1}" != "-c" ; then 
  955.   echo shar: Will not clobber existing file \"'inc/ttl.inc'\"
  956. else
  957. echo shar: Extracting \"'inc/ttl.inc'\" \(2152 characters\)
  958. sed "s/^X//" >'inc/ttl.inc' <<'END_OF_FILE'
  959. X; include all ttl types
  960. X;
  961. X; 7400 = quadruple 2-input positive-nand gates
  962. X; 7401 = quadruple 2-input positive-nand gates with open-collector outputs
  963. X; 7402 = quadruple 2-input positive-nor gates
  964. X; 7403 = quadruple 2-input positive-nand gates with open-collector outputs
  965. X; 7404 = hex inverters
  966. X; 7405 = hex inverters with open-collector outputs
  967. X; 7406 = hex inverter buffers/drivers with open-collector high-voltage outputs
  968. X; 7407 = hex buffers/drivers with open-collector high-voltage outputs
  969. X; 7408 = quadruple 2-input positive-and gates
  970. X; 7409 = quadruple 2-input positive-and gates with open-collector outputs
  971. X; 7410 = triple 3-input positive-nand gates
  972. X; 7411 = triple 3-input positive-and gates
  973. X; 7412 = triple 3-input positive-nand gates with open-collector outputs
  974. X; 7413 = dual 4-input positive-nand schmitt triggers
  975. X; 7414 = hex schmitt-trigger inverters
  976. X; 7415 = triple 3-input positive-and gates with open-collector outputs
  977. X; 7419 = schmitt-trigger inverters with totem-pole outputs
  978. X; 7420 = dual 4-input positive-nand gates
  979. X; 7421 = dual 4-input positive-and gates
  980. X; 7422 = dual 4-input positive-nand gates with open-collector outputs
  981. X; 7423 = dual 4-input nor gates with strobe
  982. X; 7424 = schmitt-trigger positive-nand gates with totem-pole outputs
  983. X; 7425 = dual 4-input nor gates with strobe
  984. X; 7426 = quadruple 2-input high-voltage interface positive-nand gates
  985. X; 7427 = triple 3-input positive-nor gates
  986. X; 7428 = quadruple 2-input positive-nor buffers
  987. X; 7430 = 8-input positive-nand gates
  988. X; 7431 = delay elements
  989. X; 7486 = quadruple 2-input exclusive-or gates
  990. X
  991. Xinclude ttl7400.inc
  992. Xinclude ttl7401.inc
  993. Xinclude ttl7402.inc
  994. Xinclude ttl7403.inc
  995. Xinclude ttl7404.inc
  996. Xinclude ttl7405.inc
  997. Xinclude ttl7406.inc
  998. Xinclude ttl7407.inc
  999. Xinclude ttl7408.inc
  1000. Xinclude ttl7409.inc
  1001. Xinclude ttl7410.inc
  1002. Xinclude ttl7411.inc
  1003. Xinclude ttl7412.inc
  1004. Xinclude ttl7413.inc
  1005. Xinclude ttl7414.inc
  1006. Xinclude ttl7415.inc
  1007. Xinclude ttl7419.inc
  1008. Xinclude ttl7420.inc
  1009. Xinclude ttl7421.inc
  1010. Xinclude ttl7422.inc
  1011. Xinclude ttl7423.inc
  1012. Xinclude ttl7424.inc
  1013. Xinclude ttl7425.inc
  1014. Xinclude ttl7426.inc
  1015. Xinclude ttl7427.inc
  1016. Xinclude ttl7428.inc
  1017. Xinclude ttl7430.inc
  1018. Xinclude ttl7431.inc
  1019. Xinclude ttl7486.inc
  1020. END_OF_FILE
  1021. if test 2152 -ne `wc -c <'inc/ttl.inc'`; then
  1022.     echo shar: \"'inc/ttl.inc'\" unpacked with wrong size!
  1023. fi
  1024. # end of 'inc/ttl.inc'
  1025. fi
  1026. if test -f 'inc/ttl7400.inc' -a "${1}" != "-c" ; then 
  1027.   echo shar: Will not clobber existing file \"'inc/ttl7400.inc'\"
  1028. else
  1029. echo shar: Extracting \"'inc/ttl7400.inc'\" \(181 characters\)
  1030. sed "s/^X//" >'inc/ttl7400.inc' <<'END_OF_FILE'
  1031. X; quadruple 2-input positive-nand gates
  1032. Xchip type=ttl7400 pins=14 horizontal=2 vertical=6
  1033. X    vcc=14
  1034. X    gnd=7
  1035. X    a1=1
  1036. X    b1=2
  1037. X    y1=3
  1038. X    a2=4
  1039. X    b2=5
  1040. X    y2=6
  1041. X    y3=8
  1042. X    a3=9
  1043. X    b3=10
  1044. X    y4=11
  1045. X    a4=12
  1046. X    b4=13
  1047. END_OF_FILE
  1048. if test 181 -ne `wc -c <'inc/ttl7400.inc'`; then
  1049.     echo shar: \"'inc/ttl7400.inc'\" unpacked with wrong size!
  1050. fi
  1051. # end of 'inc/ttl7400.inc'
  1052. fi
  1053. if test -f 'inc/ttl7401.inc' -a "${1}" != "-c" ; then 
  1054.   echo shar: Will not clobber existing file \"'inc/ttl7401.inc'\"
  1055. else
  1056. echo shar: Extracting \"'inc/ttl7401.inc'\" \(209 characters\)
  1057. sed "s/^X//" >'inc/ttl7401.inc' <<'END_OF_FILE'
  1058. X; quadruple 2-input positive-nand gates with open-collector outputs
  1059. Xchip type=ttl7401 pins=14 horizontal=2 vertical=6
  1060. X    vcc=14
  1061. X    gnd=7
  1062. X    y1=1
  1063. X    a1=2
  1064. X    b1=3
  1065. X    y2=4
  1066. X    a2=5
  1067. X    b2=6
  1068. X    a3=8
  1069. X    b3=9
  1070. X    y3=10
  1071. X    a4=11
  1072. X    b4=12
  1073. X    y4=13
  1074. END_OF_FILE
  1075. if test 209 -ne `wc -c <'inc/ttl7401.inc'`; then
  1076.     echo shar: \"'inc/ttl7401.inc'\" unpacked with wrong size!
  1077. fi
  1078. # end of 'inc/ttl7401.inc'
  1079. fi
  1080. if test -f 'inc/ttl7402.inc' -a "${1}" != "-c" ; then 
  1081.   echo shar: Will not clobber existing file \"'inc/ttl7402.inc'\"
  1082. else
  1083. echo shar: Extracting \"'inc/ttl7402.inc'\" \(189 characters\)
  1084. sed "s/^X//" >'inc/ttl7402.inc' <<'END_OF_FILE'
  1085. X; quadruple 2-input positive-nor gates
  1086. Xchip type=ttl7402 pins=14 horizontal=2 vertical=6
  1087. X     1=y1
  1088. X     2=a1
  1089. X     3=b1
  1090. X     4=y2
  1091. X     5=a2
  1092. X     6=b2
  1093. X     7=gnd
  1094. X     8=a3
  1095. X     9=b3
  1096. X    10=y3
  1097. X    11=a4
  1098. X    12=b4
  1099. X    13=y4
  1100. X    14=vcc
  1101. END_OF_FILE
  1102. if test 189 -ne `wc -c <'inc/ttl7402.inc'`; then
  1103.     echo shar: \"'inc/ttl7402.inc'\" unpacked with wrong size!
  1104. fi
  1105. # end of 'inc/ttl7402.inc'
  1106. fi
  1107. if test -f 'inc/ttl7403.inc' -a "${1}" != "-c" ; then 
  1108.   echo shar: Will not clobber existing file \"'inc/ttl7403.inc'\"
  1109. else
  1110. echo shar: Extracting \"'inc/ttl7403.inc'\" \(209 characters\)
  1111. sed "s/^X//" >'inc/ttl7403.inc' <<'END_OF_FILE'
  1112. X; quadruple 2-input positive-nand gates with open-collector outputs
  1113. Xchip type=ttl7403 pins=14 horizontal=2 vertical=6
  1114. X    vcc=14
  1115. X    gnd=7
  1116. X    a1=1
  1117. X    b1=2
  1118. X    y1=3
  1119. X    a2=4
  1120. X    b2=5
  1121. X    y2=6
  1122. X    y3=8
  1123. X    a3=9
  1124. X    b3=10
  1125. X    y4=11
  1126. X    a4=12
  1127. X    b4=13
  1128. END_OF_FILE
  1129. if test 209 -ne `wc -c <'inc/ttl7403.inc'`; then
  1130.     echo shar: \"'inc/ttl7403.inc'\" unpacked with wrong size!
  1131. fi
  1132. # end of 'inc/ttl7403.inc'
  1133. fi
  1134. if test -f 'inc/ttl7404.inc' -a "${1}" != "-c" ; then 
  1135.   echo shar: Will not clobber existing file \"'inc/ttl7404.inc'\"
  1136. else
  1137. echo shar: Extracting \"'inc/ttl7404.inc'\" \(157 characters\)
  1138. sed "s/^X//" >'inc/ttl7404.inc' <<'END_OF_FILE'
  1139. X; hex inverters
  1140. Xchip type=ttl7404 pins=14 horizontal=2 vertical=6
  1141. X    vcc=14
  1142. X    gnd=7
  1143. X    a1=1
  1144. X    y1=2
  1145. X    a2=3
  1146. X    y2=4
  1147. X    a3=5
  1148. X    y3=6
  1149. X    y4=8
  1150. X    a4=9
  1151. X    y5=10
  1152. X    a5=11
  1153. X    y6=12
  1154. X    a6=13
  1155. END_OF_FILE
  1156. if test 157 -ne `wc -c <'inc/ttl7404.inc'`; then
  1157.     echo shar: \"'inc/ttl7404.inc'\" unpacked with wrong size!
  1158. fi
  1159. # end of 'inc/ttl7404.inc'
  1160. fi
  1161. if test -f 'inc/ttl7405.inc' -a "${1}" != "-c" ; then 
  1162.   echo shar: Will not clobber existing file \"'inc/ttl7405.inc'\"
  1163. else
  1164. echo shar: Extracting \"'inc/ttl7405.inc'\" \(185 characters\)
  1165. sed "s/^X//" >'inc/ttl7405.inc' <<'END_OF_FILE'
  1166. X; hex inverters with open-collector outputs
  1167. Xchip type=ttl7405 pins=14 horizontal=2 vertical=6
  1168. X    vcc=14
  1169. X    gnd=7
  1170. X    a1=1
  1171. X    y1=2
  1172. X    a2=3
  1173. X    y2=4
  1174. X    a3=5
  1175. X    y3=6
  1176. X    y4=8
  1177. X    a4=9
  1178. X    y5=10
  1179. X    a5=11
  1180. X    y6=12
  1181. X    a6=13
  1182. END_OF_FILE
  1183. if test 185 -ne `wc -c <'inc/ttl7405.inc'`; then
  1184.     echo shar: \"'inc/ttl7405.inc'\" unpacked with wrong size!
  1185. fi
  1186. # end of 'inc/ttl7405.inc'
  1187. fi
  1188. if test -f 'inc/ttl7406.inc' -a "${1}" != "-c" ; then 
  1189.   echo shar: Will not clobber existing file \"'inc/ttl7406.inc'\"
  1190. else
  1191. echo shar: Extracting \"'inc/ttl7406.inc'\" \(213 characters\)
  1192. sed "s/^X//" >'inc/ttl7406.inc' <<'END_OF_FILE'
  1193. X; hex inverter buffers/drivers with open-collector high-voltage outputs
  1194. Xchip type=ttl7406 pins=14 horizontal=2 vertical=6
  1195. X    vcc=14
  1196. X    gnd=7
  1197. X    a1=1
  1198. X    y1=2
  1199. X    a2=3
  1200. X    y2=4
  1201. X    a3=5
  1202. X    y3=6
  1203. X    y4=8
  1204. X    a4=9
  1205. X    y5=10
  1206. X    a5=11
  1207. X    y6=12
  1208. X    a6=13
  1209. END_OF_FILE
  1210. if test 213 -ne `wc -c <'inc/ttl7406.inc'`; then
  1211.     echo shar: \"'inc/ttl7406.inc'\" unpacked with wrong size!
  1212. fi
  1213. # end of 'inc/ttl7406.inc'
  1214. fi
  1215. if test -f 'inc/ttl7407.inc' -a "${1}" != "-c" ; then 
  1216.   echo shar: Will not clobber existing file \"'inc/ttl7407.inc'\"
  1217. else
  1218. echo shar: Extracting \"'inc/ttl7407.inc'\" \(204 characters\)
  1219. sed "s/^X//" >'inc/ttl7407.inc' <<'END_OF_FILE'
  1220. X; hex buffers/drivers with open-collector high-voltage outputs
  1221. Xchip type=ttl7407 pins=14 horizontal=2 vertical=6
  1222. X    vcc=14
  1223. X    gnd=7
  1224. X    a1=1
  1225. X    y1=2
  1226. X    a2=3
  1227. X    y2=4
  1228. X    a3=5
  1229. X    y3=6
  1230. X    y4=8
  1231. X    a4=9
  1232. X    y5=10
  1233. X    a5=11
  1234. X    y6=12
  1235. X    a6=13
  1236. END_OF_FILE
  1237. if test 204 -ne `wc -c <'inc/ttl7407.inc'`; then
  1238.     echo shar: \"'inc/ttl7407.inc'\" unpacked with wrong size!
  1239. fi
  1240. # end of 'inc/ttl7407.inc'
  1241. fi
  1242. if test -f 'inc/ttl7408.inc' -a "${1}" != "-c" ; then 
  1243.   echo shar: Will not clobber existing file \"'inc/ttl7408.inc'\"
  1244. else
  1245. echo shar: Extracting \"'inc/ttl7408.inc'\" \(180 characters\)
  1246. sed "s/^X//" >'inc/ttl7408.inc' <<'END_OF_FILE'
  1247. X; quadruple 2-input positive-and gates
  1248. Xchip type=ttl7408 pins=14 horizontal=2 vertical=6
  1249. X    vcc=14
  1250. X    gnd=7
  1251. X    a1=1
  1252. X    b1=2
  1253. X    y1=3
  1254. X    a2=4
  1255. X    b2=5
  1256. X    y2=6
  1257. X    y3=8
  1258. X    a3=9
  1259. X    b3=10
  1260. X    y4=11
  1261. X    a4=12
  1262. X    b4=13
  1263. END_OF_FILE
  1264. if test 180 -ne `wc -c <'inc/ttl7408.inc'`; then
  1265.     echo shar: \"'inc/ttl7408.inc'\" unpacked with wrong size!
  1266. fi
  1267. # end of 'inc/ttl7408.inc'
  1268. fi
  1269. if test -f 'inc/ttl7409.inc' -a "${1}" != "-c" ; then 
  1270.   echo shar: Will not clobber existing file \"'inc/ttl7409.inc'\"
  1271. else
  1272. echo shar: Extracting \"'inc/ttl7409.inc'\" \(208 characters\)
  1273. sed "s/^X//" >'inc/ttl7409.inc' <<'END_OF_FILE'
  1274. X; quadruple 2-input positive-and gates with open-collector outputs
  1275. Xchip type=ttl7409 pins=14 horizontal=2 vertical=6
  1276. X    vcc=14
  1277. X    gnd=7
  1278. X    a1=1
  1279. X    b1=2
  1280. X    y1=3
  1281. X    a2=4
  1282. X    b2=5
  1283. X    y2=6
  1284. X    y3=8
  1285. X    a3=9
  1286. X    b3=10
  1287. X    y4=11
  1288. X    a4=12
  1289. X    b4=13
  1290. END_OF_FILE
  1291. if test 208 -ne `wc -c <'inc/ttl7409.inc'`; then
  1292.     echo shar: \"'inc/ttl7409.inc'\" unpacked with wrong size!
  1293. fi
  1294. # end of 'inc/ttl7409.inc'
  1295. fi
  1296. if test -f 'inc/ttl7410.inc' -a "${1}" != "-c" ; then 
  1297.   echo shar: Will not clobber existing file \"'inc/ttl7410.inc'\"
  1298. else
  1299. echo shar: Extracting \"'inc/ttl7410.inc'\" \(178 characters\)
  1300. sed "s/^X//" >'inc/ttl7410.inc' <<'END_OF_FILE'
  1301. X; triple 3-input positive-nand gates
  1302. Xchip type=ttl7410 pins=14 horizontal=2 vertical=6
  1303. X    vcc=14
  1304. X    gnd=7
  1305. X    a1=1
  1306. X    b1=2
  1307. X    a2=3
  1308. X    b2=4
  1309. X    c2=5
  1310. X    y2=6
  1311. X    y3=8
  1312. X    a3=9
  1313. X    b3=10
  1314. X    c3=11
  1315. X    y1=12
  1316. X    c1=13
  1317. END_OF_FILE
  1318. if test 178 -ne `wc -c <'inc/ttl7410.inc'`; then
  1319.     echo shar: \"'inc/ttl7410.inc'\" unpacked with wrong size!
  1320. fi
  1321. # end of 'inc/ttl7410.inc'
  1322. fi
  1323. if test -f 'inc/ttl7411.inc' -a "${1}" != "-c" ; then 
  1324.   echo shar: Will not clobber existing file \"'inc/ttl7411.inc'\"
  1325. else
  1326. echo shar: Extracting \"'inc/ttl7411.inc'\" \(177 characters\)
  1327. sed "s/^X//" >'inc/ttl7411.inc' <<'END_OF_FILE'
  1328. X; triple 3-input positive-and gates
  1329. Xchip type=ttl7411 pins=14 horizontal=2 vertical=6
  1330. X    vcc=14
  1331. X    gnd=7
  1332. X    a1=1
  1333. X    b1=2
  1334. X    a2=3
  1335. X    b2=4
  1336. X    c2=5
  1337. X    y2=6
  1338. X    y3=8
  1339. X    a3=9
  1340. X    b3=10
  1341. X    c3=11
  1342. X    y1=12
  1343. X    c1=13
  1344. END_OF_FILE
  1345. if test 177 -ne `wc -c <'inc/ttl7411.inc'`; then
  1346.     echo shar: \"'inc/ttl7411.inc'\" unpacked with wrong size!
  1347. fi
  1348. # end of 'inc/ttl7411.inc'
  1349. fi
  1350. if test -f 'inc/ttl7412.inc' -a "${1}" != "-c" ; then 
  1351.   echo shar: Will not clobber existing file \"'inc/ttl7412.inc'\"
  1352. else
  1353. echo shar: Extracting \"'inc/ttl7412.inc'\" \(206 characters\)
  1354. sed "s/^X//" >'inc/ttl7412.inc' <<'END_OF_FILE'
  1355. X; triple 3-input positive-nand gates with open-collector outputs
  1356. Xchip type=ttl7412 pins=14 horizontal=2 vertical=6
  1357. X    vcc=14
  1358. X    gnd=7
  1359. X    a1=1
  1360. X    b1=2
  1361. X    a2=3
  1362. X    b2=4
  1363. X    c2=5
  1364. X    y2=6
  1365. X    y3=8
  1366. X    a3=9
  1367. X    b3=10
  1368. X    c3=11
  1369. X    y1=12
  1370. X    c1=13
  1371. END_OF_FILE
  1372. if test 206 -ne `wc -c <'inc/ttl7412.inc'`; then
  1373.     echo shar: \"'inc/ttl7412.inc'\" unpacked with wrong size!
  1374. fi
  1375. # end of 'inc/ttl7412.inc'
  1376. fi
  1377. if test -f 'inc/ttl7413.inc' -a "${1}" != "-c" ; then 
  1378.   echo shar: Will not clobber existing file \"'inc/ttl7413.inc'\"
  1379. else
  1380. echo shar: Extracting \"'inc/ttl7413.inc'\" \(189 characters\)
  1381. sed "s/^X//" >'inc/ttl7413.inc' <<'END_OF_FILE'
  1382. X; dual 4-input positive-nand schmitt triggers
  1383. Xchip type=ttl7413 pins=14 horizontal=2 vertical=6
  1384. X    vcc=14
  1385. X    gnd=7
  1386. X    a1=1
  1387. X    b1=2
  1388. X    nc1=3
  1389. X    c1=4
  1390. X    d1=5
  1391. X    y1=6
  1392. X    y2=8
  1393. X    a2=9
  1394. X    b2=10
  1395. X    nc2=11
  1396. X    c2=12
  1397. X    d2=13
  1398. END_OF_FILE
  1399. if test 189 -ne `wc -c <'inc/ttl7413.inc'`; then
  1400.     echo shar: \"'inc/ttl7413.inc'\" unpacked with wrong size!
  1401. fi
  1402. # end of 'inc/ttl7413.inc'
  1403. fi
  1404. if test -f 'inc/ttl7414.inc' -a "${1}" != "-c" ; then 
  1405.   echo shar: Will not clobber existing file \"'inc/ttl7414.inc'\"
  1406. else
  1407. echo shar: Extracting \"'inc/ttl7414.inc'\" \(173 characters\)
  1408. sed "s/^X//" >'inc/ttl7414.inc' <<'END_OF_FILE'
  1409. X; hex schmitt-trigger inverters
  1410. Xchip type=ttl7414 pins=14 horizontal=2 vertical=6
  1411. X    vcc=14
  1412. X    gnd=7
  1413. X    a1=1
  1414. X    y1=2
  1415. X    a2=3
  1416. X    y2=4
  1417. X    a3=5
  1418. X    y3=6
  1419. X    y4=8
  1420. X    a4=9
  1421. X    y5=10
  1422. X    a5=11
  1423. X    y6=12
  1424. X    a6=13
  1425. END_OF_FILE
  1426. if test 173 -ne `wc -c <'inc/ttl7414.inc'`; then
  1427.     echo shar: \"'inc/ttl7414.inc'\" unpacked with wrong size!
  1428. fi
  1429. # end of 'inc/ttl7414.inc'
  1430. fi
  1431. if test -f 'inc/ttl7415.inc' -a "${1}" != "-c" ; then 
  1432.   echo shar: Will not clobber existing file \"'inc/ttl7415.inc'\"
  1433. else
  1434. echo shar: Extracting \"'inc/ttl7415.inc'\" \(205 characters\)
  1435. sed "s/^X//" >'inc/ttl7415.inc' <<'END_OF_FILE'
  1436. X; triple 3-input positive-and gates with open-collector outputs
  1437. Xchip type=ttl7415 pins=14 horizontal=2 vertical=6
  1438. X    vcc=14
  1439. X    gnd=7
  1440. X    a1=1
  1441. X    b1=2
  1442. X    a2=3
  1443. X    b2=4
  1444. X    c2=5
  1445. X    y2=6
  1446. X    y3=8
  1447. X    a3=9
  1448. X    b3=10
  1449. X    c3=11
  1450. X    y1=12
  1451. X    c1=13
  1452. END_OF_FILE
  1453. if test 205 -ne `wc -c <'inc/ttl7415.inc'`; then
  1454.     echo shar: \"'inc/ttl7415.inc'\" unpacked with wrong size!
  1455. fi
  1456. # end of 'inc/ttl7415.inc'
  1457. fi
  1458. if test -f 'inc/ttl7419.inc' -a "${1}" != "-c" ; then 
  1459.   echo shar: Will not clobber existing file \"'inc/ttl7419.inc'\"
  1460. else
  1461. echo shar: Extracting \"'inc/ttl7419.inc'\" \(193 characters\)
  1462. sed "s/^X//" >'inc/ttl7419.inc' <<'END_OF_FILE'
  1463. X; schmitt-trigger inverters with totem-pole outputs
  1464. Xchip type=ttl7419 pins=14 horizontal=2 vertical=6
  1465. X    vcc=14
  1466. X    gnd=7
  1467. X    a1=1
  1468. X    y1=2
  1469. X    a2=3
  1470. X    y2=4
  1471. X    a3=5
  1472. X    y3=6
  1473. X    y4=8
  1474. X    a4=9
  1475. X    y5=10
  1476. X    a5=11
  1477. X    y6=12
  1478. X    a6=13
  1479. END_OF_FILE
  1480. if test 193 -ne `wc -c <'inc/ttl7419.inc'`; then
  1481.     echo shar: \"'inc/ttl7419.inc'\" unpacked with wrong size!
  1482. fi
  1483. # end of 'inc/ttl7419.inc'
  1484. fi
  1485. if test -f 'inc/ttl7420.inc' -a "${1}" != "-c" ; then 
  1486.   echo shar: Will not clobber existing file \"'inc/ttl7420.inc'\"
  1487. else
  1488. echo shar: Extracting \"'inc/ttl7420.inc'\" \(178 characters\)
  1489. sed "s/^X//" >'inc/ttl7420.inc' <<'END_OF_FILE'
  1490. X; dual 4-input positive-nand gates
  1491. Xchip type=ttl7420 pins=14 horizontal=2 vertical=6
  1492. X    vcc=14
  1493. X    gnd=7
  1494. X    a1=1
  1495. X    b1=2
  1496. X    nc1=3
  1497. X    c1=4
  1498. X    d1=5
  1499. X    y1=6
  1500. X    y2=8
  1501. X    a2=9
  1502. X    b2=10
  1503. X    nc2=11
  1504. X    c2=12
  1505. X    d2=13
  1506. END_OF_FILE
  1507. if test 178 -ne `wc -c <'inc/ttl7420.inc'`; then
  1508.     echo shar: \"'inc/ttl7420.inc'\" unpacked with wrong size!
  1509. fi
  1510. # end of 'inc/ttl7420.inc'
  1511. fi
  1512. if test -f 'inc/ttl7421.inc' -a "${1}" != "-c" ; then 
  1513.   echo shar: Will not clobber existing file \"'inc/ttl7421.inc'\"
  1514. else
  1515. echo shar: Extracting \"'inc/ttl7421.inc'\" \(177 characters\)
  1516. sed "s/^X//" >'inc/ttl7421.inc' <<'END_OF_FILE'
  1517. X; dual 4-input positive-and gates
  1518. Xchip type=ttl7421 pins=14 horizontal=2 vertical=6
  1519. X    vcc=14
  1520. X    gnd=7
  1521. X    a1=1
  1522. X    b1=2
  1523. X    nc1=3
  1524. X    c1=4
  1525. X    d1=5
  1526. X    y1=6
  1527. X    y2=8
  1528. X    a2=9
  1529. X    b2=10
  1530. X    nc2=11
  1531. X    c2=12
  1532. X    d2=13
  1533. END_OF_FILE
  1534. if test 177 -ne `wc -c <'inc/ttl7421.inc'`; then
  1535.     echo shar: \"'inc/ttl7421.inc'\" unpacked with wrong size!
  1536. fi
  1537. # end of 'inc/ttl7421.inc'
  1538. fi
  1539. if test -f 'inc/ttl7422.inc' -a "${1}" != "-c" ; then 
  1540.   echo shar: Will not clobber existing file \"'inc/ttl7422.inc'\"
  1541. else
  1542. echo shar: Extracting \"'inc/ttl7422.inc'\" \(206 characters\)
  1543. sed "s/^X//" >'inc/ttl7422.inc' <<'END_OF_FILE'
  1544. X; dual 4-input positive-nand gates with open-collector outputs
  1545. Xchip type=ttl7422 pins=14 horizontal=2 vertical=6
  1546. X    vcc=14
  1547. X    gnd=7
  1548. X    a1=1
  1549. X    b1=2
  1550. X    nc1=3
  1551. X    c1=4
  1552. X    d1=5
  1553. X    y1=6
  1554. X    y2=8
  1555. X    a2=9
  1556. X    b2=10
  1557. X    nc2=11
  1558. X    c2=12
  1559. X    d2=13
  1560. END_OF_FILE
  1561. if test 206 -ne `wc -c <'inc/ttl7422.inc'`; then
  1562.     echo shar: \"'inc/ttl7422.inc'\" unpacked with wrong size!
  1563. fi
  1564. # end of 'inc/ttl7422.inc'
  1565. fi
  1566. if test -f 'inc/ttl7423.inc' -a "${1}" != "-c" ; then 
  1567.   echo shar: Will not clobber existing file \"'inc/ttl7423.inc'\"
  1568. else
  1569. echo shar: Extracting \"'inc/ttl7423.inc'\" \(194 characters\)
  1570. sed "s/^X//" >'inc/ttl7423.inc' <<'END_OF_FILE'
  1571. X; dual 4-input nor gates with strobe
  1572. Xchip type=ttl7423 pins=16 horizontal=2 vertical=6
  1573. X    vcc=16
  1574. X    gnd=8
  1575. X    x1=1
  1576. X    a1=2
  1577. X    b1=3
  1578. X    g1=4
  1579. X    c1=5
  1580. X    d1=6
  1581. X    y1=7
  1582. X    y2=9
  1583. X    a2=10
  1584. X    b2=11
  1585. X    g2=12
  1586. X    c2=13
  1587. X    d2=14
  1588. X    xbar=15
  1589. END_OF_FILE
  1590. if test 194 -ne `wc -c <'inc/ttl7423.inc'`; then
  1591.     echo shar: \"'inc/ttl7423.inc'\" unpacked with wrong size!
  1592. fi
  1593. # end of 'inc/ttl7423.inc'
  1594. fi
  1595. if test -f 'inc/ttl7424.inc' -a "${1}" != "-c" ; then 
  1596.   echo shar: Will not clobber existing file \"'inc/ttl7424.inc'\"
  1597. else
  1598. echo shar: Extracting \"'inc/ttl7424.inc'\" \(203 characters\)
  1599. sed "s/^X//" >'inc/ttl7424.inc' <<'END_OF_FILE'
  1600. X; schmitt-trigger positive-nand gates with totem-pole outputs
  1601. Xchip type=ttl7424 pins=14 horizontal=2 vertical=6
  1602. X    vcc=14
  1603. X    gnd=7
  1604. X    a1=1
  1605. X    b1=2
  1606. X    y1=3
  1607. X    a2=4
  1608. X    b2=5
  1609. X    y2=6
  1610. X    y3=8
  1611. X    a3=9
  1612. X    b3=10
  1613. X    y4=11
  1614. X    a4=12
  1615. X    b4=13
  1616. END_OF_FILE
  1617. if test 203 -ne `wc -c <'inc/ttl7424.inc'`; then
  1618.     echo shar: \"'inc/ttl7424.inc'\" unpacked with wrong size!
  1619. fi
  1620. # end of 'inc/ttl7424.inc'
  1621. fi
  1622. if test -f 'inc/ttl7425.inc' -a "${1}" != "-c" ; then 
  1623.   echo shar: Will not clobber existing file \"'inc/ttl7425.inc'\"
  1624. else
  1625. echo shar: Extracting \"'inc/ttl7425.inc'\" \(178 characters\)
  1626. sed "s/^X//" >'inc/ttl7425.inc' <<'END_OF_FILE'
  1627. X; dual 4-input nor gates with strobe
  1628. Xchip type=ttl7425 pins=14 horizontal=2 vertical=6
  1629. X    vcc=14
  1630. X    gnd=7
  1631. X    a1=1
  1632. X    b1=2
  1633. X    g1=3
  1634. X    c1=4
  1635. X    d1=5
  1636. X    y1=6
  1637. X    y2=8
  1638. X    a2=9
  1639. X    b2=10
  1640. X    g2=11
  1641. X    c2=12
  1642. X    d2=13
  1643. END_OF_FILE
  1644. if test 178 -ne `wc -c <'inc/ttl7425.inc'`; then
  1645.     echo shar: \"'inc/ttl7425.inc'\" unpacked with wrong size!
  1646. fi
  1647. # end of 'inc/ttl7425.inc'
  1648. fi
  1649. if test -f 'inc/ttl7426.inc' -a "${1}" != "-c" ; then 
  1650.   echo shar: Will not clobber existing file \"'inc/ttl7426.inc'\"
  1651. else
  1652. echo shar: Extracting \"'inc/ttl7426.inc'\" \(204 characters\)
  1653. sed "s/^X//" >'inc/ttl7426.inc' <<'END_OF_FILE'
  1654. X; quadruple 2-input high-voltage interface positive-nand gates
  1655. Xchip type=ttl7426 pins=14 horizontal=2 vertical=6
  1656. X    vcc=14
  1657. X    gnd=7
  1658. X    a1=1
  1659. X    b1=2
  1660. X    y1=3
  1661. X    a2=4
  1662. X    b2=5
  1663. X    y2=6
  1664. X    y3=8
  1665. X    a3=9
  1666. X    b3=10
  1667. X    y4=11
  1668. X    a4=12
  1669. X    b4=13
  1670. END_OF_FILE
  1671. if test 204 -ne `wc -c <'inc/ttl7426.inc'`; then
  1672.     echo shar: \"'inc/ttl7426.inc'\" unpacked with wrong size!
  1673. fi
  1674. # end of 'inc/ttl7426.inc'
  1675. fi
  1676. if test -f 'inc/ttl7427.inc' -a "${1}" != "-c" ; then 
  1677.   echo shar: Will not clobber existing file \"'inc/ttl7427.inc'\"
  1678. else
  1679. echo shar: Extracting \"'inc/ttl7427.inc'\" \(177 characters\)
  1680. sed "s/^X//" >'inc/ttl7427.inc' <<'END_OF_FILE'
  1681. X; triple 3-input positive-nor gates
  1682. Xchip type=ttl7427 pins=14 horizontal=2 vertical=6
  1683. X    vcc=14
  1684. X    gnd=7
  1685. X    a1=1
  1686. X    b1=2
  1687. X    a2=3
  1688. X    b2=4
  1689. X    c2=5
  1690. X    y2=6
  1691. X    y3=8
  1692. X    a3=9
  1693. X    b3=10
  1694. X    c3=11
  1695. X    y1=12
  1696. X    c1=13
  1697. END_OF_FILE
  1698. if test 177 -ne `wc -c <'inc/ttl7427.inc'`; then
  1699.     echo shar: \"'inc/ttl7427.inc'\" unpacked with wrong size!
  1700. fi
  1701. # end of 'inc/ttl7427.inc'
  1702. fi
  1703. if test -f 'inc/ttl7428.inc' -a "${1}" != "-c" ; then 
  1704.   echo shar: Will not clobber existing file \"'inc/ttl7428.inc'\"
  1705. else
  1706. echo shar: Extracting \"'inc/ttl7428.inc'\" \(182 characters\)
  1707. sed "s/^X//" >'inc/ttl7428.inc' <<'END_OF_FILE'
  1708. X; quadruple 2-input positive-nor buffers
  1709. Xchip type=ttl7428 pins=14 horizontal=2 vertical=6
  1710. X    vcc=14
  1711. X    gnd=7
  1712. X    y1=1
  1713. X    a1=2
  1714. X    b1=3
  1715. X    y2=4
  1716. X    a2=5
  1717. X    b2=6
  1718. X    a3=8
  1719. X    b3=9
  1720. X    y3=10
  1721. X    a4=11
  1722. X    b4=12
  1723. X    y4=13
  1724. END_OF_FILE
  1725. if test 182 -ne `wc -c <'inc/ttl7428.inc'`; then
  1726.     echo shar: \"'inc/ttl7428.inc'\" unpacked with wrong size!
  1727. fi
  1728. # end of 'inc/ttl7428.inc'
  1729. fi
  1730. if test -f 'inc/ttl7430.inc' -a "${1}" != "-c" ; then 
  1731.   echo shar: Will not clobber existing file \"'inc/ttl7430.inc'\"
  1732. else
  1733. echo shar: Extracting \"'inc/ttl7430.inc'\" \(165 characters\)
  1734. sed "s/^X//" >'inc/ttl7430.inc' <<'END_OF_FILE'
  1735. X; 8-input positive-nand gates
  1736. Xchip type=ttl7430 pins=14 horizontal=2 vertical=6
  1737. X    vcc=14
  1738. X    gnd=7
  1739. X    a=1
  1740. X    b=2
  1741. X    c=3
  1742. X    d=4
  1743. X    e=5
  1744. X    f=6
  1745. X    y=8
  1746. X    nc1=9
  1747. X    nc2=10
  1748. X    g=11
  1749. X    h=12
  1750. X    nc3=13
  1751. END_OF_FILE
  1752. if test 165 -ne `wc -c <'inc/ttl7430.inc'`; then
  1753.     echo shar: \"'inc/ttl7430.inc'\" unpacked with wrong size!
  1754. fi
  1755. # end of 'inc/ttl7430.inc'
  1756. fi
  1757. if test -f 'inc/ttl7431.inc' -a "${1}" != "-c" ; then 
  1758.   echo shar: Will not clobber existing file \"'inc/ttl7431.inc'\"
  1759. else
  1760. echo shar: Extracting \"'inc/ttl7431.inc'\" \(172 characters\)
  1761. sed "s/^X//" >'inc/ttl7431.inc' <<'END_OF_FILE'
  1762. X; delay elements
  1763. Xchip type=ttl7431 pins=16 horizontal=2 vertical=6
  1764. X    vcc=16
  1765. X    gnd=8
  1766. X    a1=1
  1767. X    y1=2
  1768. X    a2=3
  1769. X    y2=4
  1770. X    a3=5
  1771. X    b3=6
  1772. X    y3=7
  1773. X    y4=9
  1774. X    a4=10
  1775. X    b4=11
  1776. X    y5=12
  1777. X    a5=13
  1778. X    y6=14
  1779. X    a6=15
  1780. END_OF_FILE
  1781. if test 172 -ne `wc -c <'inc/ttl7431.inc'`; then
  1782.     echo shar: \"'inc/ttl7431.inc'\" unpacked with wrong size!
  1783. fi
  1784. # end of 'inc/ttl7431.inc'
  1785. fi
  1786. if test -f 'inc/ttl7486.inc' -a "${1}" != "-c" ; then 
  1787.   echo shar: Will not clobber existing file \"'inc/ttl7486.inc'\"
  1788. else
  1789. echo shar: Extracting \"'inc/ttl7486.inc'\" \(180 characters\)
  1790. sed "s/^X//" >'inc/ttl7486.inc' <<'END_OF_FILE'
  1791. X; quadruple 2-input exclusive-or gates
  1792. Xchip type=ttl7486 pins=14 horizontal=2 vertical=6
  1793. X    vcc=14
  1794. X    gnd=7
  1795. X    a1=1
  1796. X    b1=2
  1797. X    y1=3
  1798. X    a2=4
  1799. X    b2=5
  1800. X    y2=6
  1801. X    y3=8
  1802. X    a3=9
  1803. X    b3=10
  1804. X    y4=11
  1805. X    a4=12
  1806. X    b4=13
  1807. END_OF_FILE
  1808. if test 180 -ne `wc -c <'inc/ttl7486.inc'`; then
  1809.     echo shar: \"'inc/ttl7486.inc'\" unpacked with wrong size!
  1810. fi
  1811. # end of 'inc/ttl7486.inc'
  1812. fi
  1813. if test ! -d 'old' ; then
  1814.     echo shar: Creating directory \"'old'\"
  1815.     mkdir 'old'
  1816. fi
  1817. if test -f 'old/bitmap.c' -a "${1}" != "-c" ; then 
  1818.   echo shar: Will not clobber existing file \"'old/bitmap.c'\"
  1819. else
  1820. echo shar: Extracting \"'old/bitmap.c'\" \(1599 characters\)
  1821. sed "s/^X//" >'old/bitmap.c' <<'END_OF_FILE'
  1822. X#include "cell.h"
  1823. X
  1824. X#define ZOOM0    3    /* 3x3 pixels per cell        */
  1825. X#define ZOOM1    6    /* 6x6 pixels per cell        */
  1826. X#define ZOOM2    10    /* 10x10 pixels per cell    */
  1827. X#define ZOOM3    18    /* 18x18 pixels per cell    */
  1828. X
  1829. X/*
  1830. X** the templates assume the pixels on your screen have a 1:1 aspect ratio. for
  1831. X** almost all screens, this is not true. therefore, the screen view will be
  1832. X** slightly distorted (things will look like they are stretched top to bottom,
  1833. X** or squashed side to side). if you really want things to look like reality,
  1834. X** you could change the dimensions of the templates. for example, if your
  1835. X** screen has a 2:1 aspect ratio (most are more like 1.4:1), use a [3][6]
  1836. X** template instead of a [3][3] one. as long as you keep this in mind while
  1837. X** viewing the results, it's probably not worth the effort.
  1838. X*/
  1839. X
  1840. Xstruct x { /* group the bit templates for an object */
  1841. X    long t;            /* the object type    */
  1842. X    char t0[ZOOM0][ZOOM0];    /* tiny zoom template    */
  1843. X    char t1[ZOOM1][ZOOM1];    /* small zoom template    */
  1844. X    char t2[ZOOM2][ZOOM2];    /* medium zoom template    */
  1845. X    char t3[ZOOM3][ZOOM3];    /* large zoom template    */
  1846. X    };
  1847. X
  1848. X/* these got too big to keep in one file, so i moved them to include files */
  1849. X
  1850. Xstruct x y1[] = {  /* hole templates */
  1851. X#include "bitmap1.h"
  1852. X    };
  1853. X
  1854. Xstruct x y2[] = {  /* hole-related templates */
  1855. X#include "bitmap2.h"
  1856. X    };
  1857. X
  1858. Xstruct x y3[] = {  /* non-hole-related templates */
  1859. X#include "bitmap3.h"
  1860. X    };
  1861. X
  1862. Xint z1 = sizeof(y1)/sizeof(y1[0]);  /* number of hole types        */
  1863. Xint z2 = sizeof(y2)/sizeof(y2[0]);  /* number of hole-related types    */
  1864. Xint z3 = sizeof(y3)/sizeof(y3[0]);  /* number of non-hole-related types    */
  1865. END_OF_FILE
  1866. if test 1599 -ne `wc -c <'old/bitmap.c'`; then
  1867.     echo shar: \"'old/bitmap.c'\" unpacked with wrong size!
  1868. fi
  1869. # end of 'old/bitmap.c'
  1870. fi
  1871. if test -f 'old/bitmap1.h' -a "${1}" != "-c" ; then 
  1872.   echo shar: Will not clobber existing file \"'old/bitmap1.h'\"
  1873. else
  1874. echo shar: Extracting \"'old/bitmap1.h'\" \(1397 characters\)
  1875. sed "s/^X//" >'old/bitmap1.h' <<'END_OF_FILE'
  1876. X/* hole templates */
  1877. X/* NOTE: these templates are UPSIDE-DOWN from what you see on the screen!!! */
  1878. X
  1879. X     { HOLE,
  1880. X
  1881. X        { { 0,0,0 },
  1882. X          { 0,1,0 },
  1883. X          { 0,0,0 } },
  1884. X
  1885. X        { { 0,0,0,0,0,0 },
  1886. X          { 0,0,1,1,0,0 },
  1887. X          { 0,1,0,0,1,0 },
  1888. X          { 0,1,0,0,1,0 },
  1889. X          { 0,0,1,1,0,0 },
  1890. X          { 0,0,0,0,0,0 } },
  1891. X
  1892. X        { { 0,0,0,0,0,0,0,0,0,0 },
  1893. X          { 0,0,0,0,0,0,0,0,0,0 },
  1894. X          { 0,0,0,0,1,1,0,0,0,0 },
  1895. X          { 0,0,0,1,0,0,1,0,0,0 },
  1896. X          { 0,0,1,0,0,0,0,1,0,0 },
  1897. X          { 0,0,1,0,0,0,0,1,0,0 },
  1898. X          { 0,0,0,1,0,0,1,0,0,0 },
  1899. X          { 0,0,0,0,1,1,0,0,0,0 },
  1900. X          { 0,0,0,0,0,0,0,0,0,0 },
  1901. X          { 0,0,0,0,0,0,0,0,0,0 } },
  1902. X
  1903. X        { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1904. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1905. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1906. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1907. X          { 0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0 },
  1908. X          { 0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0 },
  1909. X          { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
  1910. X          { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
  1911. X          { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
  1912. X          { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
  1913. X          { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
  1914. X          { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
  1915. X          { 0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0 },
  1916. X          { 0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0 },
  1917. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1918. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1919. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
  1920. X          { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
  1921. X     }
  1922. END_OF_FILE
  1923. if test 1397 -ne `wc -c <'old/bitmap1.h'`; then
  1924.     echo shar: \"'old/bitmap1.h'\" unpacked with wrong size!
  1925. fi
  1926. # end of 'old/bitmap1.h'
  1927. fi
  1928. if test -f 'queue.c' -a "${1}" != "-c" ; then 
  1929.   echo shar: Will not clobber existing file \"'queue.c'\"
  1930. else
  1931. echo shar: Extracting \"'queue.c'\" \(3363 characters\)
  1932. sed "s/^X//" >'queue.c' <<'END_OF_FILE'
  1933. X#include <stdio.h>
  1934. X
  1935. X/*
  1936. X#ifndef M_XENIX
  1937. X#include <stdlib.h>
  1938. X#endif
  1939. X*/
  1940. X
  1941. X/*
  1942. X#include <malloc.h>
  1943. X*/
  1944. X#include "cell.h"
  1945. X
  1946. Xextern char *Alloc();
  1947. X
  1948. Xstruct queue { /* search queue structure */
  1949. X    int Row;    /* current row                    */
  1950. X    int Col;    /* current column                */
  1951. X    int Side;    /* 0=top, 1=bottom                */
  1952. X    int Dist;    /* path distance to this cell so far        */
  1953. X    int ApxDist;    /* approximate distance to target from here    */
  1954. X    struct queue *Next;
  1955. X    };
  1956. X
  1957. X/* search statistics */
  1958. Xlong OpenNodes = 0; /* total number of nodes opened */
  1959. Xlong ClosNodes = 0; /* total number of nodes closed */
  1960. Xlong MoveNodes = 0; /* total number of nodes moved */
  1961. Xlong MaxNodes = 0; /* maximum number of nodes opened at one time */
  1962. X
  1963. Xstatic long qlen = 0; /* current queue length */
  1964. X
  1965. Xstatic struct queue *Head = NULL;
  1966. Xstatic struct queue *Tail = NULL;
  1967. Xstatic struct queue *Save = NULL; /* hold empty queue structs */
  1968. X
  1969. Xextern void Nomem();
  1970. X
  1971. Xvoid InitQueue();
  1972. Xvoid GetQueue();
  1973. Xvoid SetQueue();
  1974. Xvoid ReSetQueue();
  1975. X
  1976. Xvoid InitQueue () { /* initialize the search queue */
  1977. X    struct queue *p;
  1978. X
  1979. X    while (p = Head) {
  1980. X        Head = p->Next;
  1981. X        p->Next = Save;
  1982. X        Save = p;
  1983. X        }
  1984. X    Tail = NULL;
  1985. X    OpenNodes = ClosNodes = MoveNodes = MaxNodes = qlen = 0;
  1986. X    }
  1987. X
  1988. Xvoid GetQueue ( r, c, s, d, a ) /* get search queue item from list */
  1989. X    int *r, *c, *s, *d, *a;
  1990. X    {
  1991. X    struct queue *p;
  1992. X
  1993. X    if (p = Head) { /* return first item in list */
  1994. X        *r = p->Row;
  1995. X        *c = p->Col;
  1996. X        *s = p->Side;
  1997. X        *d = p->Dist;
  1998. X        *a = p->ApxDist;
  1999. X        if (!(Head = p->Next))
  2000. X            Tail = NULL;
  2001. X        /* put node on free list */
  2002. X        p->Next = Save;
  2003. X        Save = p;
  2004. X        ClosNodes++;
  2005. X        qlen--;
  2006. X        }
  2007. X    else /* empty list */
  2008. X        *r = *c = *s = *d = *a = ILLEGAL;
  2009. X    }
  2010. X
  2011. Xvoid SetQueue ( r, c, s, d, a, r2, c2 ) /* add a search node to the list */
  2012. X    int r, c, s, d, a, r2, c2;
  2013. X    {
  2014. X    struct queue *p;
  2015. X    struct queue *q;
  2016. X    struct queue *t;
  2017. X    register int i;
  2018. X    int j;
  2019. X
  2020. X    if (p = Save) /* try free list first */
  2021. X        Save = p->Next;
  2022. X    else if (!(p = (struct queue *)Alloc( (long)sizeof(struct queue) )))
  2023. X        Nomem();
  2024. X    p->Row = r;
  2025. X    p->Col = c;
  2026. X    p->Side = s;
  2027. X    i = (p->Dist = d) + (p->ApxDist = a);
  2028. X    p->Next = NULL;
  2029. X    if (q = Head) { /* insert in proper position in list */
  2030. X        if (q->Dist + q->ApxDist > i) { /* insert at head */
  2031. X            p->Next = q;
  2032. X            Head = p;
  2033. X            }
  2034. X        else { /* search for proper position */
  2035. X            for (t = q, q = q->Next;
  2036. X                q && i > (j = q->Dist + q->ApxDist);
  2037. X                t = q, q = q->Next)
  2038. X                ;
  2039. X            if (q && i == j && q->Row == r2 && q->Col == c2) {
  2040. X                /* insert after q, which is a goal node */
  2041. X                if (!(p->Next = q->Next))
  2042. X                    Tail = p;
  2043. X                q->Next = p;
  2044. X                }
  2045. X            else { /* insert in front of q */
  2046. X                if (!(p->Next = q))
  2047. X                    Tail = p;
  2048. X                t->Next = p;
  2049. X                }
  2050. X            }
  2051. X        }
  2052. X    else /* empty search list */
  2053. X        Head = Tail = p;
  2054. X    OpenNodes++;
  2055. X    if (++qlen > MaxNodes)
  2056. X        MaxNodes = qlen;
  2057. X    }
  2058. X
  2059. Xvoid ReSetQueue ( r, c, s, d, a, r2, c2 ) /* reposition node in list */
  2060. X    register int r, c;
  2061. X    int s, d, a, r2, c2;
  2062. X    {
  2063. X    struct queue *p;
  2064. X    struct queue *q;
  2065. X
  2066. X    /* first, see if it is already in the list */
  2067. X    for (q = NULL, p = Head; p; q = p, p = p->Next) {
  2068. X        if (p->Row == r && p->Col == c && p->Side == s) {
  2069. X            /* old one to remove */
  2070. X            if (q) {
  2071. X                if (!(q->Next = p->Next))
  2072. X                    Tail = q;
  2073. X                }
  2074. X            else if (!(Head = p->Next))
  2075. X                Tail = NULL;
  2076. X            p->Next = Save;
  2077. X            Save = p;
  2078. X            OpenNodes--;
  2079. X            MoveNodes++;
  2080. X            qlen--;
  2081. X            break;
  2082. X            }
  2083. X        }
  2084. X    /* if it was there, it's gone now; insert it at the proper position */
  2085. X    SetQueue( r, c, s, d, a, r2, c2 );
  2086. X    }
  2087. END_OF_FILE
  2088. if test 3363 -ne `wc -c <'queue.c'`; then
  2089.     echo shar: \"'queue.c'\" unpacked with wrong size!
  2090. fi
  2091. # end of 'queue.c'
  2092. fi
  2093. if test -f 'sources.hdr' -a "${1}" != "-c" ; then 
  2094.   echo shar: Will not clobber existing file \"'sources.hdr'\"
  2095. else
  2096. echo shar: Extracting \"'sources.hdr'\" \(1862 characters\)
  2097. sed "s/^X//" >'sources.hdr' <<'END_OF_FILE'
  2098. XChecksum: 1535076610  (Verify with "brik -cv")
  2099. XPosting-number: Volume 02, Issue 061
  2100. XSubmitted-by: microsoft!randyn@beaver.cs.washington.edu (Randy Nevin)
  2101. XArchive-name: pcbcad/part01
  2102. X
  2103. Xthis is a printed circuit board cad package for the ibm pc; please post it
  2104. Xon comp.binaries.ibm.pc. it consists of an autorouter, a printed circuit
  2105. Xboard viewer, and a printed circuit board printer. it currently supports
  2106. Xega and hp laser jet II. source is included, along with an article i have
  2107. Xsubmitted to dr. dobb's journal (and may be printed later this year), and
  2108. Xa small ttl library. i have also sent it to keith peterson, so it will be
  2109. Xavailable in the simtel20 archives for ftp access.  note that the
  2110. Xexecutables included have been compiled to use 286 instructions; if you
  2111. Xwant to run these programs on an XT (not recommended), change the /G2s
  2112. Xto /Gs in the makefile and recompile.
  2113. X
  2114. X randy nevin  (microsoft!randyn@beaver.cs.washington.edu, or
  2115. X               microsoft!randyn@uunet.uu.net)
  2116. X
  2117. X[
  2118. XTo try out the provided example in the file "example", first type
  2119. X"pcbroute example outfile" to get the generated circuit into "outfile",
  2120. Xthen type "pcbview outfile" to view it.  It worked fine on a
  2121. XVGA-equipped IBM PS/2 with about 450K of free memory.
  2122. X
  2123. XAll the source code (all C but for one small assembly language file) is
  2124. Xhere, suitable for Microsoft C 4.0 and MASM 4.0.
  2125. X
  2126. XThere is a good discussion of the algorithms needed to optimize the
  2127. Xlayout of traces on a PCB.
  2128. X
  2129. XChecksums obtained with the 4.3BSD "sum" or System V "sum -r" command.
  2130. X
  2131. Xchecksum     size (bytes)  file (between BEGIN--cut and END--cut lines)
  2132. X   15220        43731      part01
  2133. X   41974        43772      part02
  2134. X   22640        43772      part03
  2135. X    5344        43122      part04
  2136. X
  2137. Xchecksum     size (bytes)  file
  2138. X   13593       126558      pcbcad.arc
  2139. X
  2140. X-- R.D.
  2141. X]
  2142. X
  2143. Xpcbcad part01/04
  2144. XBEGIN--cut here--cut here
  2145. END_OF_FILE
  2146. if test 1862 -ne `wc -c <'sources.hdr'`; then
  2147.     echo shar: \"'sources.hdr'\" unpacked with wrong size!
  2148. fi
  2149. # end of 'sources.hdr'
  2150. fi
  2151. if test -f 'util.c' -a "${1}" != "-c" ; then 
  2152.   echo shar: Will not clobber existing file \"'util.c'\"
  2153. else
  2154. echo shar: Extracting \"'util.c'\" \(266 characters\)
  2155. sed "s/^X//" >'util.c' <<'END_OF_FILE'
  2156. Xextern struct RastPort *rastp;
  2157. X
  2158. X/*
  2159. X * write a dot on the screen
  2160. X */
  2161. Xvoid Dot( color, pixrow, pixcol )
  2162. Xint color, pixrow, pixcol;
  2163. X{
  2164. X    SetAPen(rastp,(long)color);
  2165. X    WritePixel(rastp,(long)pixcol,(long)pixrow);
  2166. X}
  2167. X
  2168. XClearPCB()
  2169. X{
  2170. X    Move(rastp,0L,15L);
  2171. X    ClearScreen(rastp);
  2172. X}
  2173. END_OF_FILE
  2174. if test 266 -ne `wc -c <'util.c'`; then
  2175.     echo shar: \"'util.c'\" unpacked with wrong size!
  2176. fi
  2177. # end of 'util.c'
  2178. fi
  2179. if test -f 'work.c' -a "${1}" != "-c" ; then 
  2180.   echo shar: Will not clobber existing file \"'work.c'\"
  2181. else
  2182. echo shar: Extracting \"'work.c'\" \(2810 characters\)
  2183. sed "s/^X//" >'work.c' <<'END_OF_FILE'
  2184. X#include <stdio.h>
  2185. X
  2186. X/*
  2187. X#ifndef M_XENIX
  2188. X#include <stdlib.h>
  2189. X#endif
  2190. X
  2191. X#include <malloc.h>
  2192. X*/
  2193. X#include "cell.h"
  2194. X
  2195. Xextern char *Alloc();
  2196. X
  2197. Xstruct work { /* a unit of work is a hole-pair to connect */
  2198. X    int FromRow;        /* source row        */
  2199. X    int FromCol;        /* source column    */
  2200. X    char *FromName;    /* source name        */
  2201. X    int ToRow;        /* target row        */
  2202. X    int ToCol;        /* target column    */
  2203. X    char *ToName;    /* target name        */
  2204. X    int ApxDist;        /* approximate distance    */
  2205. X    int Priority;        /* 0=no, 1=yes        */
  2206. X    struct work *Next;
  2207. X    };
  2208. X
  2209. X/* pointers to the first and last item of work to do */
  2210. Xstatic struct work *Head = NULL;
  2211. Xstatic struct work *Tail = NULL;
  2212. X
  2213. Xextern int Ntotal;
  2214. X
  2215. Xextern int GetApxDist();
  2216. Xextern void Nomem();
  2217. X
  2218. Xvoid InitWork();
  2219. Xvoid SetWork();
  2220. Xvoid GetWork();
  2221. Xvoid SortWork();
  2222. X
  2223. Xvoid InitWork () { /* initialize the work list */
  2224. X    struct work *p;
  2225. X
  2226. X    while (p = Head) {
  2227. X        Head = p->Next;
  2228. X        Free( p );
  2229. X        }
  2230. X    Tail = NULL;
  2231. X    }
  2232. X
  2233. Xvoid SetWork ( r1, c1, n1, r2, c2, n2, pri )
  2234. X    /* add a unit of work to the work list */
  2235. X    int r1, c1, r2, c2, pri;
  2236. X    char *n1;
  2237. X    char *n2;
  2238. X    {
  2239. X    struct work *p;
  2240. X
  2241. X    if (p = (struct work *)Alloc( (long)sizeof(struct work) )) {
  2242. X        p->FromRow = r1;
  2243. X        p->FromCol = c1;
  2244. X        p->FromName = n1;
  2245. X        p->ToRow = r2;
  2246. X        p->ToCol = c2;
  2247. X        p->ToName = n2;
  2248. X        p->ApxDist = GetApxDist( r1, c1, r2, c2 );
  2249. X        p->Priority = pri;
  2250. X        p->Next = NULL;
  2251. X        if (Head) /* attach at end */
  2252. X            Tail->Next = p;
  2253. X        else /* first in list */
  2254. X            Head = p;
  2255. X        Tail = p;
  2256. X        Ntotal++;
  2257. X        }
  2258. X    else /* can't get any more memory */
  2259. X        Nomem();
  2260. X    }
  2261. X
  2262. Xvoid GetWork ( r1, c1, n1, r2, c2, n2 )
  2263. X    /* fetch a unit of work from the work list */
  2264. X    int *r1, *c1, *r2, *c2;
  2265. X    char **n1;
  2266. X    char **n2;
  2267. X    {
  2268. X    struct work *p;
  2269. X
  2270. X    if (p = Head) {
  2271. X        *r1 = p->FromRow;
  2272. X        *c1 = p->FromCol;
  2273. X        *n1 = p->FromName;
  2274. X        *r2 = p->ToRow;
  2275. X        *c2 = p->ToCol;
  2276. X        *n2 = p->ToName;
  2277. X        if (!(Head = p->Next))
  2278. X            Tail = NULL;
  2279. X        Free( p );
  2280. X        }
  2281. X    else { /* none left */
  2282. X        *r1 = *c1 = *r2 = *c2 = ILLEGAL;
  2283. X        *n1 = *n2 = NULL;
  2284. X        }
  2285. X    }
  2286. X
  2287. Xvoid SortWork () { /* order the work items; shortest first */
  2288. X    struct work *p;
  2289. X    struct work *q0; /* put PRIORITY CONNECTs in q0 */
  2290. X    struct work *q1; /* sort other CONNECTs in q1 */
  2291. X    struct work *r;
  2292. X
  2293. X    q0 = q1 = NULL;
  2294. X    while (p = Head) { /* prioritize each work item */
  2295. X        Head = Head->Next;
  2296. X        if (p->Priority) {
  2297. X            if (!(r = q0)) {
  2298. X                p->Next = q0;
  2299. X                q0 = p;
  2300. X                }
  2301. X            else {
  2302. X                while (r->Next)
  2303. X                    r = r->Next;
  2304. X                p->Next = r->Next;
  2305. X                r->Next = p;
  2306. X                }
  2307. X            }
  2308. X        else if (!(r = q1) || p->ApxDist < q1->ApxDist) {
  2309. X            p->Next = q1;
  2310. X            q1 = p;
  2311. X            }
  2312. X        else { /* find proper position in list */
  2313. X            while (r->Next && p->ApxDist >= r->ApxDist)
  2314. X                r = r->Next;
  2315. X            p->Next = r->Next;
  2316. X            r->Next = p;
  2317. X            }
  2318. X        }
  2319. X    if (p = q0) {
  2320. X        while (q0->Next)
  2321. X            q0 = q0->Next;
  2322. X        q0->Next = q1;
  2323. X        }
  2324. X    else
  2325. X        p = q1;
  2326. X    /* reposition Head and Tail */
  2327. X    for (Tail = Head = p; Tail && Tail->Next; Tail = Tail->Next)
  2328. X        ;
  2329. X    }
  2330. END_OF_FILE
  2331. if test 2810 -ne `wc -c <'work.c'`; then
  2332.     echo shar: \"'work.c'\" unpacked with wrong size!
  2333. fi
  2334. # end of 'work.c'
  2335. fi
  2336. echo shar: End of archive 1 \(of 6\).
  2337. cp /dev/null ark1isdone
  2338. MISSING=""
  2339. for I in 1 2 3 4 5 6 ; do
  2340.     if test ! -f ark${I}isdone ; then
  2341.     MISSING="${MISSING} ${I}"
  2342.     fi
  2343. done
  2344. if test "${MISSING}" = "" ; then
  2345.     echo You have unpacked all 6 archives.
  2346.     rm -f ark[1-9]isdone
  2347. else
  2348.     echo You still need to unpack the following archives:
  2349.     echo "        " ${MISSING}
  2350. fi
  2351. ##  End of shell archive.
  2352. exit 0
  2353. -- 
  2354. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  2355. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  2356. Post requests for sources, and general discussion to comp.sys.amiga.
  2357.